Code Red > AutoLISP (Vanilla / Visual)

Edit nested Text

(1/1)

Biscuits:
Hello everyone. Was wondering if anyone has any lisp ideas to edit text buried in a block without using bedit or refedit.
This is not an attribute but should have been. Been searching the internet but not getting anywhere. Would like something like a command line version of find/replace. Any help would be appreciated. Using Autocad Map3D 2017.

ronjonp:
You can do it like this but it will change all references in the drawing ( may need to regen to see changes ).

--- Code - Auto/Visual Lisp: ---(defun c:foo (/ e)  (if (and (setq e (car (nentsel "\nPick text: ")))           (setq e (vlax-ename->vla-object e))           (vlax-write-enabled-p e)           (vlax-property-available-p e 'textstring)      )    (vla-put-textstring e "Your string")  )  (princ))

jtoverka:

--- Quote from: Biscuits on October 22, 2020, 09:05:12 AM ---Would like something like a command line version of find/replace.

--- End quote ---

I use this regularly. It has the option to find and replace block text. It is very robust. Although it is not command line, it can do multiple drawings in the background, and save a batch of find and replace options for the next time you run AutoCAD.

http://www.lee-mac.com/bfind.html

Biscuits:
Thanks guys. Both methods will be a great help.
Stay safe!

Navigation

[0] Message Index

Go to full version