Add suffix to Dimension text in block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello,.
i want a lisp to add suffix "(A)", "(B)", "(C)" to block Dimension text.
i found a code by lee mac for find replace text.
but it replace text in all blocks in drawing.
Code :-
(defun c:SDReplace ( / _StringSubst old new doc ) (vl-load-com)
;; © Lee Mac 2011
(defun _StringSubst ( new old str / i l ) (setq i 0 l (strlen new))
(while
(and
(< i (strlen str))
(setq i (vl-string-search old str i))
(setq str (vl-string-subst new old str i) i (+ i l))
)
)
str
)
(setq old (getstring t "\nFind What: "))
(setq new (getstring t "\nReplace With: "))
(vlax-for block
(vla-get-blocks
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
)
(if
(and
(eq :vlax-false (vla-get-isXref block))
(eq :vlax-false (vla-get-isLayout block))
)
(vlax-for obj block
(if (wcmatch (vla-get-objectname obj) "AcDb*Text")
(vla-put-TextString obj (_StringSubst new old (vla-get-TextString obj)))
)
)
)
)
(vla-regen doc acActiveViewport)
(princ)
)......
Please help for this code replace selected block Dimension Text only.
Sorry for my English 🙂