Capture 1

AutoCAD Tip: Convert MTEXT to Multileader

All, Architecture and Engineering, Construction, Fabrication, Manufacturing 4 Comments

Recently I have had several calls asking if it was possible to convert regular MTEXT to a multileader.  Well, AutoCAD doesn’t have the capabilities to do so, but I found a snazzy lisp routine years ago on the AutoCAD Tips blog that does the trick.  In theire blog titled Add Leader to Text – Make Multileader they have this lips routine:

(defun c:mt2ml ( / oobj nobj nstrg)
(vl-load-com)
(setq oobj (vlax-ename->vla-object (car (nentsel “\nSelect source text: “))))
(if (= (vlax-get-property oobj ‘ObjectName) “AcDbMText”)
(setq nstrg (vlax-get-property oobj ‘TextString))
(exit)
)
(command “_MLEADER”)
(while (= 1 (logand (getvar “CMDACTIVE”) 1)) (command PAUSE))
(setq nobj (vlax-ename->vla-object (entlast)))
(if (= (vlax-get-property nobj ‘ObjectName) “AcDbMLeader”)
(vlax-put-property nobj ‘TextString nstrg)
(exit)
)
(entdel (vlax-vla-object->ename oobj))
(princ)
)

I could not attach the lisp routine to the post as stated in the video.  Simply copy the red text above to a Notepad file and save it as MT2ML.lsp and it will be ready to use.  Once done and loaded in AutoCAD this should happen:

Comments

  1. This lisp routine works – PROVIDED you replace the all the curly single and double quotes in the red text with straight ones (as typed on a keyboard). Otherwise it will just throw an error message …

    1. Author

      Trevor, I found the lisp routine on another forum as is and it works fine for me. I’m surprised you have to edit anything. However, thanks for letting us know.

      1. Perhaps they get converted to ‘smart’ quotes on pasting into the blog … or maybe it is MY browser, who knows? anyway thanks for posting the routine, it helped me convert a large number of MTEXT entities so it did the job …

  2. Pingback: Combining an EXISTING leader and mtext - Autodesk Civil Engineering Community Center

Leave a Comment