what version of CAD are you running? If it's the full version, then you probably already have this feature via Express Tools. type TXT2MTXT at the command line and follow the prompt.
![]()



Registered forum members do not see this ad.
Subject Convert text to mtext in lisp?
What lisp command to convert strings to mtext?
I am looking for (or maybe making) a lisp routine that would change text
to mtext by allowing the user to select a group of strings in a drawing.
The routine would change the first text string to mtext then
allow the user edit that string. Then the routine would go down to the second string to make a mtext conversion then let the user edit that string. Then the rountine would to the the third string and so on. Hopefully the routine would move form left to right then down. Simular movement as reading a book. Has anyone done this??
First things first, Does anyone know a lisp command to convert text to mtext?
thank you,
Last edited by muck; 24th Sep 2007 at 08:53 pm.
what version of CAD are you running? If it's the full version, then you probably already have this feature via Express Tools. type TXT2MTXT at the command line and follow the prompt.
![]()
Tannar Frampton | Facilities Engineering | Revit 2013
Personal Projects | Fender Squier Stratocaster | Custom Smoker | Concrete Patio



AutoCAD Version 2007. I noticed when a person uses a pull down (ie txt2mtxt) menu to select a group of texts strings the command will put all the strings into one mtext box. Usually the top mtext box. I really don't want that. If I select 10 text strings to convert to mtext I would like to get 10 mtext boxes in there orginal postions by window picking a group of text strings. Hopefully the mtext would be in the same positions as the previous
text strings.
thank you,
That can be done in lisp, but most people wanted to group severeal dtexts into one mtext.
What bout this: run the command txt2mtxt, select one text, then press enter to repeat and select the next and so on?




Try this...
Code:;changes text to individual mtext by Carl B. (princ "\nType T2M to start") (defun c:t2m () (setq Tset (ssget '((0 . "*TEXT")))) ;filter text in selection set (setq Setlen (sslength Tset) ;setq number of entties in selection set, setq count(er) to 0 Count 0 ) (repeat SetLen ;repeat setq times (setq Ename (ssname Tset Count)) ;setq ename to be the "0..." entity in selection set Tset (command "_txt2mtxt" Ename "") (setq Count (+ 1 Count)) ; add 1 to Count(er) ) ; Repeat (princ) )



I will try the above code and see what it does.
Here is one thing I have found.
(command "txt2mtxt" "")
;Opens Mtext Conversion options dialog. If I turn off wordwrap
;feature in the dialog box my window conversions will keep the text in
;place but I don't know how to turn off that the wordwrap
;feature using lisp. Interesting Information.




ToolPac includes a routine to convert multiple TEXT entities to MTEXT, without combining them.
I read this and I would like to know if there are some lsp routine to change the high of mtext at same time, por example, if I have 10 mtext box, but with differents highs, select all of them and give them the same high, and keeping the same start point.
Thank for the help!!
Oskr
Yes, it's possible but the problem with Mtext is that you can have all kinds of format overrides inside the text.
If the Mtexts are all with default formatting, you can use the Properties window to change the hight.



Registered forum members do not see this ad.
Biggest problem I have is matching mtext widths with orginal text withs
after converting text to mtext.
thank you,
Bookmarks