CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 2102 

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)
  (princ)
)
ACAD
100% *  CAD 
10.9.2011    7124x  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
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.
Tip 4059:How to change Text/Dtext objects into MText objects?


Back   All CAD Tips All CAD tips&tricks

Using the DWG TrueView viewer as a drawing editor. « | » How to change dark red highlighting of parts in Inventor 2012?

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   



Featuring:
DwgTextTranslator translates a series of drawings from one language to another using MS Access.
Download a fully functional trial version.


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