CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 2932 

CAD tip CAD tip # 8201:

Question CAD 
 %  platform  category 
Q - question

How to convert DTexts to MTexts (individually)?

A - answer 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)
100% *  CAD 
10.9.2011    11135×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
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.
Tip 10958:Extended TCase supports accented characters and small caps.
Tip 10952:All DWG texts in UPPERCASE.

Back   All CAD Tips All CAD tips&tricks

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 glossary   

Extend your AutoCAD LT productivity with our popular add-on
CADstudio LT Extension More info

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