CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
New CADforum look launched.
Over 1.081.000 registered users (EN+CZ). New 1D nesting and 3D nesting tools, updated Color converter. New AutoCAD 2025 commands and variables. Learn about twiGIS.

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    18215×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
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.
Tip 10972:Replace text fields with static texts.


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:
Use Google Earth images in your AutoCAD projects with the Plex.Earth Tools 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