Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Does the AutoCAD API have a find and replace function, as found in AutoCAD itself?
Solved! Go to Solution.
Does the AutoCAD API have a find and replace function, as found in AutoCAD itself?
Solved! Go to Solution.
Apparently Express Tools provides an ACET-STR-FIND and an ACET-STR-M-FIND function. I have never used either of them but you could experiment with them, OR wait for someone who knows to answer.
John F. Uhden
@oransen ,
The AutoLISP equivalent of this would be to use SSGET to capture all TEXT and/or MTEXT objects in the drawing, then (if you'd like) using one of the acet functions that @john.uhden is referring to. Something like:
... (setq ssText (ssget "_X" '((0 . "*TEXT")))) (setq txt2find "oldText") (setq txt2replace "NEWTXT") (setq isMtext nil) (repeat (setq cnt (sslength ssText)) (setq e (ssname ssText (setq cnt (1- cnt)))) (setq eg (entget e)) (if (member '(0 . "MTEXT") eg) (setq isMtext t)) (if isMtext (setq txt (getpropertyvalue e "Contents")) (setq txt (getpropertyvalue e "TextString")) );if (setq txt (acet-str-replace txt2find txt2replace txt t)) (if isMtext (setpropertyvalue e "Contents" txt) (setpropertyvalue e "TextString" txt) );if );repeat (prompt "\nText Replaced!") ...
...you can use the "(acet...)" function ONLY assuming you have express tools loaded.
Best,
~DD