If you have existing MTEXT objects and would like to add a leader to it and make into a Multileader object, this LISP will be your friend. The text objects do need to be MTEXT objects for this routine to work correctly. So you may need to use the TXT2MTXT command (express tools).
Here’s how:
- MT2ML <enter> to start
- Select the MTEXT object that you’d like to add a  leader to.
- Specify where the arrow portion of the leader should go.
- Specify the first vertex of the leader.
Once you have the leader set – hit <enter> to complete.
(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) )
Pingback: Text to Multileader | AutoCAD Tips
Hi couldnt find another spot for this,
My question, just got 2013 installed here at work and the txt2mtxt does not work at all even after installing expresstools and restarting autocad. Any way around this?
Please see the post about loading Express Tools for 2013.
https://autocadtips.wordpress.com/2012/04/16/load-express-tools-for-2013/
~Greg
I stumbled upon this looking for a way to re-attach a leader to the text. Im having the same problem as j did… Though, Im using 2012. ExpressTools is installed, but I get “Unknown command “MT2ML”. Press F1 for help.”
J,
The command MT2ML is loaded using the section of code that is below the post. Please see the following links for how to copy the code and use it – it really only requires notepad, so it isn’t too involved.
https://autocadtips.wordpress.com/2011/06/22/how-to-copy-code-from-the-internet-and-this-blog/
Some of my older posts have weird formatting and require you to follow this method to copy the code
https://autocadtips.wordpress.com/2011/05/01/copying-lisp-code-from-this-blog/
Excellent!
How do I change this code to combine with a leader instead of a multileader? I changed the parts where mleader is called but after drawing the leader AutoCAD freezes.
This is great! Thanks so much for sharing! A tip to anyone who reads this far down: prior to running the MT2ML command set the dimstyle, layer, and annotation scale you want the MLeader on and the Mtext will convert to the Mleader with those settings