CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.091.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 8201:

Question

CAD 
 %  platform  category 
A
The TXT2MTXT command can be used to convert multiple texts to a single Mtext. But if you need to just convert the type of multiple drawing objects from Text to MText - without combining them - you can use the following simple AutoLISP code.

Save it to txt1mtxt.lsp, load it with APPLOAD and start the TXT1MTXT command:

; CADstudio TXT1MTXT - text to mtext (individual)
(defun c:txt1mtxt (/ ss lst x)
  (setvar "CMDECHO" 0)
  (command "_undo" "_begin")
  (setq ss (ssget '((0 . "TEXT"))))
  (setq lst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
  (mapcar '(lambda (x) (command "txt2mtxt" x "")) lst)
  (command "_undo" "_end")
  (setvar "CMDECHO" 1)
  (princ)
)
ACAD
100% *CAD
10.9.2011    19025×  
applies to: AutoCAD ·

See also:
Tip 14446:Undocumented options in AutoCAD FIELDs - hyperlinks, hexadecimal or binary format
Tip 13831:ReplMTcol - recoloring parts of text in paragraph Mtext.
Tip 13006:Calculated property descriptions (tobogan slide from floor to floor)
Tip 11289:Adding, multiplying and rounding numbers inside DWG drawing texts - NumInText.
Tip 11128:How to convert lines forming a text to a text entity.


Back    All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD: 
OS: 
Categ: 
Text:
 FAQ
  



Featuring:
Save your floating licenses (NLS) consumed by inactive users - free unused licenses with
LogOff 2006 More info


Please use these tips at your own risk.
ARKANCE is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist