Convert All Fields to Text
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)
)
Re: Convert All Fields to Text
The first link in Similar Threads at the bottom of the page: https://forums.augi.com/showthread.p...=1#post1296764
Easily found with a quick search in this forum.
You need to Wrap Code tags around any code you post.
Clicking the [Go Advanced] button at the bottom puts a toolbar at the top and the # icon in that toolbar places code tags around for you or simply paste your code inside.
Re: Convert All Fields to Text
Yeah I found that one before I posted this.
That requires you to select what text objects you want.
I'm trying to modify it to select all text objects without me having to select the objects manually.
Re: Convert All Fields to Text
Quote:
Originally Posted by
barshnizza494659
Yeah I found that one before I posted this.
That requires you to select what text objects you want.
I'm trying to modify it to select all text objects without me having to select the objects manually.
Using R-FIELDS-ALL didn't prompt to select anything for me and it converted every field to text for me.
What lisp did you try?
Re: Convert All Fields to Text
Quote:
Originally Posted by
Tom Beauford
Using R-FIELDS-ALL didn't prompt to select anything for me and it converted every field to text for me.
What lisp did you try?
Thanks Tom, I already had an "R-Fields-All" that I had downloaded from one of these forums.
It looked identical to the one on the link you provided.
I just tried the one from the link you provided again and it worked, so apparently mine wasn't exactly the same.
The R-Fields-All you're referencing works for me now.
Thanks for the help!