AutoCAD 2010/2011/2012

Reply
Contributor
mpbalda
Posts: 15
Registered: ‎12-06-2012
Message 1 of 3 (130 Views)
Accepted Solution

MLEADERS

130 Views, 2 Replies
12-28-2012 02:21 AM

I have about (5) different styles of mleaders defined. They are styles 1 thru 5. Style 1 is a 2 line leader with arrowhead, style 2 is a one line leader with arrowhead  style 3 is a 2 line leader with dot, etc. I typically use style 1 and I have that as my default setting. When I need a different style leader, I have to open the mleaderstyle dialog box, change the style, draw the leader, open the dialog box again and change back to style 1. I would like to write a lisp routine to do this (i.e. when I enter 'LDR2' it automatically changes the mleader style to '2', I then draw the leader, and then it changes the mleader style back to '1'). I have not been able to find a command or function that I can put into a lisp routine that will change the style of an mleader. Is there an easy way tio do this?

You could do something like this. (Note that I did not include any error handling here).

 

(defun C:LDR2 ()
(setvar "cmleaderstyle" "2")
(vl-cmdf "._mleader")
(while
(eq
(logand
(getvar "CMDACTIVE")
1)
1)
(command pause)
)
(setvar "cmleaderstyle" "1")
(princ)
)

 

You could probably use command buttons on the tool palette to do this also, without having to use any lisp code.

Perfect - thx.

*Expert Elite*
rkmcswain
Posts: 3,429
Registered: ‎11-13-2006
Message 2 of 3 (118 Views)

Re: MLEADERS

12-28-2012 04:43 AM in reply to: mpbalda

You could do something like this. (Note that I did not include any error handling here).

 

(defun C:LDR2 ()  
  (setvar "cmleaderstyle" "2")
  (vl-cmdf "._mleader")
  (while
    (eq
      (logand
	(getvar "CMDACTIVE")
      1)
     1)
      (command pause)
  )
 (setvar "cmleaderstyle" "1")
 (princ)
)

 

You could probably use command buttons on the tool palette to do this also, without having to use any lisp code.

Contributor
mpbalda
Posts: 15
Registered: ‎12-06-2012
Message 3 of 3 (85 Views)

Re: MLEADERS

01-02-2013 01:45 PM in reply to: rkmcswain

Perfect - thx.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.