CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 5428
Plex.Earth connects AutoCAD and Google Earth

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    17593×  
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 glossary   



Featuring:
Export 3D VRML scenes from AutoCAD and Inventor
VRMLout More info


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