Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Text to Mtext without txt2mtxt

34 REPLIES 34
Reply
Message 1 of 35
tclark0506
2778 Views, 34 Replies

Text to Mtext without txt2mtxt

Does anyone know of a lisp that can convert text to mtext but will allow you to select multi pieces of text and will create multiple mtext entities, not one mtext entity. I would also hope it would work like TJUST and would maintain the text position. I am trying to change multiple text entities to mtext to use the backgound coloring capabilities so I do not have to run into problems with wipeouts. I do not see a need to use the wipeouts for text masking if I can use a background color. Why even bother with text. If anyone has anything to offer on this post that would be great.
34 REPLIES 34
Message 21 of 35
tclark0506
in reply to: tclark0506

I tried to make all the changes to the code that you guys have suggested. I still can not seem to get it to work. I am getting this on the command line "no function definition: NO :error#0". Can anyone help. I have attached the lisp as I have adjusted it. The original format is listed above. Thanks
Message 22 of 35
RKLindner
in reply to: tclark0506

I believe it was the 14th line down that went awry.. see the attached file that works on my system.

Richard
Message 23 of 35
tclark0506
in reply to: tclark0506

Much better. Thank you so much. How long have you been writting lisps. I have heard the best way to get started is through the AutoLISP Developers Guide. How long would you think it would take to have a reasonable good understanding of AutoLISP and do you have any other suggestions on getting start with AutoLISP.
Message 24 of 35
RKLindner
in reply to: tclark0506

You're welcome. As for how long, I have been using Acad for over 20 yrs and have been dabbling in Lisp (and now VBA) along the way. I am far from being an expert in Lisp, I just look thru the info available and try to find other routines that might do something similar and modify from there. Sometimes I get lucky and it works!
Message 25 of 35

great lisp, however
i included your modification (cons 8 curlay) but all the mtext still gets plonked onto a layer "text"
i've attached the modified lisp could you tell me what is wrong if you would be so kind
thanks
pete
Message 26 of 35
RKLindner
in reply to: tclark0506

See the revised lisp that I posted on the other branch of this thread. I think both of you took something too literally. The "curlay (no "") meant to use the variable CURLAY, but don't include the quotes.

Richard
Message 27 of 35

thanks that works great now
pete
Message 28 of 35
Anonymous
in reply to: tclark0506

Great routine. I would add this to your code:

(if (not ai_aselect)(load "ai_utils.lsp"))

--

Gary
Message 29 of 35
RKLindner
in reply to: tclark0506

No problem. Glad to hear its working
Message 30 of 35
tclark0506
in reply to: tclark0506

I have just one more request with this lisp. I noticed that it is setting the color to bylayer and making the letters all upper case. Is there a easy way to have the lisp not change the color or text case?
Message 31 of 35
Anonymous
in reply to: tclark0506

for the upper case issue..

change line 16 from:
(setq mcontent (cons '1 (strcase (cdr (assoc 1 el)))))
to:
(setq mcontent (cons '1 (cdr (assoc 1 el))))
Message 32 of 35
tclark0506
in reply to: tclark0506

Thanks that worked great. One down. One to go. 😉
Message 33 of 35
RKLindner
in reply to: tclark0506

To do the items that you requested, look for the line (setq mcontent... and change it as follows and add the subsequent lines after it...

[code] (setq mcontent (cons '1 (cdr (assoc 1 el))))
(setq curcolor (cdr (assoc 62 el)))
(if (= curcolor nil)
(setq curcolor 256)
)[/code]

also,

on the line (setq nmtext .. you need to add (cons 62 curcolor) after where we added the curlay option.

These 2 items will leave the text in it's original case and also will maintain the current color (ie. bylayer or implicit color)
Message 34 of 35
tclark0506
in reply to: tclark0506

That worked out great. Thank you so much for your help. It is greatly appreciated. Thanks to everyone that helped. Let me know if there is anything I can do for you. Thanks again.
Message 35 of 35
RKLindner
in reply to: tclark0506

You're welcome. All those "items" can be found in the Help. If you look in the Developers section under "DXF" codes, you'll see where we found the Group codes necessary to make the changes you were asking.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost