Add Leader to Text – Make Multileader

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)
)
About these ads

About AutoCAD Tips

I work for a large engineering firm and perform various CAD Administration duties and. I enjoy teaching/tutoring people in AutoCAD and seeing them enjoy using the program as much as I do. I hope that you find this blog a useful tool.
This entry was posted in AutoLISP, AutoLISP: Text, Leaders, Text. Bookmark the permalink.

5 Responses to Add Leader to Text – Make Multileader

  1. Pingback: Text to Multileader | AutoCAD Tips

  2. j says:

    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?

  3. JD says:

    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.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s