I'm trying to get a lisp file that will select all text / mtext and convert any fields to plain text or mtext.
I have the below lisp that does this beautifully, but it requires me to manually select what text objects I want.
All I want to change is the selection. Instead of being prompted to select, I would like it to select all mtext or text objects.
Any help would be greatly appreciated!
(defun c:FITOTXT ( / *error* doc i ss obj str)
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(vla-StartUndoMark doc)
(setq i 0)
(if (setq ss (ssget ":L" '((0 . "TEXT,MTEXT"))))
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss i))
str (vlax-get obj 'TextString)
)
(if (not (eq str (vla-FieldCode obj)))
(progn
(vlax-put obj 'TextString " ")
(vlax-put obj 'TextString str)
)
)
(setq i (1+ i))
)
)
(*error* nil)
)