Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
48 Posts
0 Kudos
Registered: ‎03-11-2003
Post 1 of 8

Convert Quick Leader to Multileader?

1773 Views, 7 Replies
09-19-2008 08:30 AM
Does anyone have a routine or know of one that will convert Quick Leaders to Multileaders?
Contributor
24 Posts
1 Kudo
Registered: ‎09-23-2008
Post 2 of 8

Re: Convert Quick Leader to Multileader?

10-02-2008 02:18 PM in reply to: richdclemons
Here is a little lisp I created awhile back. Hope it work for you.

;LEADER2MULTILEADER
;Converts autocad leaders with text or mtext to autocad 2008+ multileaders
;created by Jeffery Allen - 11/1/2007

(defun C:LD2MLD (/ ent1 ent1-gcode ent1-type leader-pt-list leader-1st-pt leader-2nd-pt
ent2 ent2-gcode ent2-type text-strg)

(setq ent1(car(entsel "\nSelect a Leader: "))
ent1-gcode(entget ent1)
ent1-type(cdr(assoc 0 ent1-gcode))
)
(if(= ent1-type "LEADER")
(progn
(setq leader-pt-list(member(assoc 10 ent1-gcode) ent1-gcode)
leader-1st-pt(cdr(car leader-pt-list))
leader-2nd-pt(cdr(cadr leader-pt-list))
ent2(car(entsel "\nSelect Text or Mtext: "))
ent2-gcode(entget ent2)
ent2-type(cdr(assoc 0 ent2-gcode))
)
(if(or(= ent2-type "TEXT")(= ent2-type "MTEXT"))
(progn
(setq text-strg(cdr(assoc 1 ent2-gcode)))
(setvar "OSMODE" (boole 7 (getvar "OSMODE") 16384));osnap off
(setvar "CMDECHO" 0);command echo off
(command "_.ERASE" ent1 ent2 ""
"_.MLEADER" leader-1st-pt leader-2nd-pt text-strg
)
(setvar "CMDECHO" 1);command echo on
(setvar "OSMODE" (boole 2 (getvar "OSMODE") 16384));osnap on
)
)
(if(and(/= ent2-type "TEXT")(/= ent2-type "MTEXT"))(alert "Object selected is not a text or mtext"))
)
)
(if(/= ent1-type "LEADER")(alert "Object selected is not a leader"))
(princ)
);defun

(setq message "Leader 2 Multileader loaded...

Converts autocad leaders with text or
mtext to autocad 2008+ multileaders

Created by Jeffery Allen - 11/1/2007

Start command with \"LD2MLD\"")
(alert message)
(setq message nil)
(princ)

(c:LD2MLD)
Contributor
24 Posts
1 Kudo
Registered: ‎09-23-2008
Post 3 of 8

Re: Convert Quick Leader to Multileader?

10-02-2008 02:18 PM in reply to: richdclemons
Here is a little lisp I created awhile back. Hope it work for you.

;LEADER2MULTILEADER
;Converts autocad leaders with text or mtext to autocad 2008+ multileaders
;created by Jeffery Allen - 11/1/2007

(defun C:LD2MLD (/ ent1 ent1-gcode ent1-type leader-pt-list leader-1st-pt leader-2nd-pt
ent2 ent2-gcode ent2-type text-strg)

(setq ent1(car(entsel "\nSelect a Leader: "))
ent1-gcode(entget ent1)
ent1-type(cdr(assoc 0 ent1-gcode))
)
(if(= ent1-type "LEADER")
(progn
(setq leader-pt-list(member(assoc 10 ent1-gcode) ent1-gcode)
leader-1st-pt(cdr(car leader-pt-list))
leader-2nd-pt(cdr(cadr leader-pt-list))
ent2(car(entsel "\nSelect Text or Mtext: "))
ent2-gcode(entget ent2)
ent2-type(cdr(assoc 0 ent2-gcode))
)
(if(or(= ent2-type "TEXT")(= ent2-type "MTEXT"))
(progn
(setq text-strg(cdr(assoc 1 ent2-gcode)))
(setvar "OSMODE" (boole 7 (getvar "OSMODE") 16384));osnap off
(setvar "CMDECHO" 0);command echo off
(command "_.ERASE" ent1 ent2 ""
"_.MLEADER" leader-1st-pt leader-2nd-pt text-strg
)
(setvar "CMDECHO" 1);command echo on
(setvar "OSMODE" (boole 2 (getvar "OSMODE") 16384));osnap on
)
)
(if(and(/= ent2-type "TEXT")(/= ent2-type "MTEXT"))(alert "Object selected is not a text or mtext"))
)
)
(if(/= ent1-type "LEADER")(alert "Object selected is not a leader"))
(princ)
);defun

(setq message "Leader 2 Multileader loaded...

Converts autocad leaders with text or
mtext to autocad 2008+ multileaders

Created by Jeffery Allen - 11/1/2007

Start command with \"LD2MLD\"")
(alert message)
(setq message nil)
(princ)

(c:LD2MLD)
Active Contributor
48 Posts
0 Kudos
Registered: ‎03-11-2003
Post 4 of 8

Re: Convert Quick Leader to Multileader?

10-03-2008 07:53 AM in reply to: richdclemons
Jeffery, you are a life saver my friend...this routine works like a charm!

Thanks!!
Contributor
24 Posts
1 Kudo
Registered: ‎09-23-2008
Post 5 of 8

Re: Convert Quick Leader to Multileader?

10-07-2008 10:13 AM in reply to: richdclemons
your welcome
Contributor
25 Posts
1 Kudo
Registered: ‎03-25-2011
Post 6 of 8

Re: Convert Quick Leader to Multileader?

08-07-2014 04:23 PM in reply to: Ktiger12

I realize this is old, but I just found it and I love it. You saved me so much time.

 

Question, will this load everytime I open cad (2015)

Active Contributor
37 Posts
0 Kudos
Registered: ‎10-15-2008
Post 7 of 8

Re: Convert Quick Leader to Multileader?

08-08-2014 05:53 AM in reply to: jshorttiller

If you add it to your acad.lsp to load or in the startup suite it will load every time. Also make sure it is in the support file search path.

 

I have used similar lisps and made a small addition to it. If you notice it changes the qleader to the current mleader style. We have 6 different mleader styles we use so I added a setting of the mleader style and just modified the defun for which style I wanted. ex. 4" text = l2m4, 3" = l2m3, etc.

 

(defun c:L2M4 ()
(setvar "cmleaderstyle" "your Multileader style name here")

New Member
1 Posts
0 Kudos
Registered: ‎09-12-2014
Post 8 of 8

Re: Convert Quick Leader to Multileader?

10-10-2014 07:30 AM in reply to: Ktiger12

Thank you for sharing this.  It has been very helpful!!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!