Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting ordinate dimention prefix or suffix

Status
Not open for further replies.

malaycobra

Civil/Environmental
Nov 6, 2002
42
Is there any way to set ordinate dimension prefix or suffix. I use this dim style for building floor heights and would like AGL or EL with the dim text.

If not, is there a better way to show this dim?
 
Replies continue below

Recommended for you

Go to Dimension Style/Modify/Primary Units. In this window you can add a prefix or suffix to the actual dimension. Remember to save it and set current.
 
Wouldn't that apply the prefix/suffix to all dims?
 
Then it's not an option, unless I set up a dimstyle especially for my elevation dims.

Guess that might work.

Thanks for the advice
 
This will let you choose which dims to change...

(defun ADDDIMSUFFIX (/ CNT DIMENT DIMSS NEWDIM SUF)
(setq DIMSS (ssget '((0 . "DIMENSION")))
CNT 0
SUF "AGL")
(while (< CNT (sslength DIMSS))
(setq DIMENT(entget(ssname DIMSS CNT)))
(setq NEWDIM (cons 1 (ST_SREP "<>"(strcat "<>" " " SUF)(cdr(assoc 1 DIMENT)))))
(entmod (subst NEWDIM (assoc 1 DIMENT) DIMENT))
(setq CNT (+ CNT 1))
) ;while
) ;defun

(defun st_srep (srch_str rep_str target_str / str_pad result i)
(setq str_pad target_str
result ""
)
(while ; str_scan returns nil when the search string is not found
(setq i (st_scan srch_str str_pad))
(setq result
(strcat
result
(substr str_pad 1 (1- i))
rep_str
)
)
(setq str_pad ; remove section copied to !result from str_pad
(substr str_pad (+ i (strlen srch_str)))
)
)
; copy any leftover data to the !result string
(if (> (strlen str_pad) 0)
(setq result (strcat result str_pad))
)
result
)

(defun st_scan (object target / obj_len targ_len rep_limit i result)
(setq obj_len (strlen object))
(setq targ_len (strlen target))
(setq rep_limit (- targ_len obj_len -1))
(setq i 0)
(while
(cond
( (> (setq i (1+ i)) rep_limit)
(setq result nil)
nil ; at the end of the string - stop the loop
)
( (= object (substr target i obj_len ))
(setq result i)
nil ; substring found - stop the loop
)
(T T) ; otherwise continue
)
)
result
)

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor