Need a LISP for Dot blank leader

Need a LISP for Dot blank leader

krishravi2000
Enthusiast Enthusiast
1,383 Views
14 Replies
Message 1 of 15

Need a LISP for Dot blank leader

krishravi2000
Enthusiast
Enthusiast

Hi Guys,

I am using both Qleader and dot blank leader, I am using normal command for qleader instead of going to properties and changing the leader to blank I want a lisp that automatically results in dot blank leader
i.e If I press Q and press enter it activates Qleader When I press QQ and enter the result of the command should be of dot blank leader.

0 Likes
Accepted solutions (1)
1,384 Views
14 Replies
Replies (14)
Message 2 of 15

VincentSheehan
Advisor
Advisor

Try this. You'll need to setup two MLeader Styles. I created Blank_Leader and Dot_Blank_Leader shown below.

 

(defun C:Q ()
   (command "cmleaderstyle")
   (command "Blank_Leader")
   (command "Mleader")

   (princ)
)

(defun C:QQ ()
   (command "cmleaderstyle")
   (command "Dot_Blank_Leader")
   (command "Mleader")
   
   (princ)
)

 

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 3 of 15

krishravi2000
Enthusiast
Enthusiast

Hi sir,
the LISP that previously mentioned showing error & function cancelled. 

krishravi2000_0-1741921760275.png

 

 

0 Likes
Message 4 of 15

VincentSheehan
Advisor
Advisor

Did you change the lisp to your mleader styles? The two bold text will need to be changed to your mleader styles.

 

(defun C:Q ()
(command "cmleaderstyle")
(command "Blank_Leader")
(command "Mleader")

(princ)
)

(defun C:QQ ()
(command "cmleaderstyle")
(command "Dot_Blank_Leader")
(command "Mleader")

(princ)
)

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 5 of 15

krishravi2000
Enthusiast
Enthusiast

The lisp still showing error sir

krishravi2000_0-1741947928919.png

 

0 Likes
Message 6 of 15

VincentSheehan
Advisor
Advisor

So I created two mleader styles with the names in the lisp. Load the lisp then I can type Q or QQ to place the two different mleaders. It works on my end. Can you screen shot your Multileader Style Manager?

 

(view in My Videos)

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 7 of 15

krishravi2000
Enthusiast
Enthusiast

hi sir
I made some slight changes in the lisp.

(defun C:Q ()
(command "STANDARD")
(command "Blank_Leader")
(command "Qleader")

(princ)
)

(defun C:QQ ()
(command "STANDARD")
(command "Dot_Blank_Leader")
(command "Qleader")

(princ)
)

krishravi2000_0-1741951462264.png

 

(view in My Videos)

 

0 Likes
Message 8 of 15

VincentSheehan
Advisor
Advisor

Okay, I see you are using QLeader. You'll need to create the Dot_Blank_Leader and Blank_Leader styles in the Dimension Style Manager.

 

(defun C:Q ()
(command "-dimstyle")
(command "restore")
(command "Blank_Leader")
(command "Qleader")

(princ)
)

(defun C:QQ ()
(command "-dimstyle")
(command "restore")
(command "Dot_Blank_Leader")
(command "Qleader")

(princ)
)

 

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 9 of 15

krishravi2000
Enthusiast
Enthusiast

The Q command is working perfectly but the QQ command is also resulting in closed filled leader sir.

krishravi2000_1-1741954029254.png

 

 

(view in My Videos)

 

0 Likes
Message 10 of 15

VincentSheehan
Advisor
Advisor

Check the Dim Style.

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

0 Likes
Message 11 of 15

Kent1Cooper
Consultant
Consultant

@krishravi2000 wrote:

... the QQ command is also resulting in closed filled leader sir.


Kent1Cooper_1-1742229507647.png

The command-line history tells you what the problem is.  The Dimension Style must exist in the drawing, and its name must be spelled correctly in the routine.

Kent Cooper, AIA
0 Likes
Message 12 of 15

krishravi2000
Enthusiast
Enthusiast

Hello guys,
Sorry for the late reply I was sick for past few days, I changed the leader type name in the lisp and it still shows the same error unknown dimension style

(defun C:QQ ()
(command "-dimstyle")
(command "restore")
(command "Dot Blank")
(command "Qleader")

(princ)
)

 

krishravi2000_0-1742465805074.png

 



0 Likes
Message 13 of 15

komondormrex
Mentor
Mentor

hey,

what kind of leaders do you want? are they leaders without annotation?

0 Likes
Message 14 of 15

Kent1Cooper
Consultant
Consultant
Accepted solution

@krishravi2000 wrote:

....

(defun C:QQ ()
(command "-dimstyle")
(command "restore")
(command "Dot Blank")
(command "Qleader")

(princ)
)

krishravi2000_0-1742465805074.png


Then you don't have a Dimension Style by that name in the drawing.  If you think you do, are you sure you spelled it exactly the same way?  For example, could the Style really be named Dot_Blank with an underscore, rather than with a space?  [The actual Block name is _DotBlank with the prefixed underscore -- might you have named the Style that way?]

And by the way [and this is also applicable to several earlier Messages in this Topic] you don't need to put each entry into its own separate (command) function.  You can include not just options and arguments within one command, but even more than one command entirely, within one such function.  You can do [assuming you fix the unknown-style problem]:

(defun C:QQ ()
  (command "-dimstyle" "restore" "Dot Blank" "Qleader")

  (princ)
)

Kent Cooper, AIA
0 Likes
Message 15 of 15

komondormrex
Mentor
Mentor

komondormrex_0-1742671215518.gif

 

0 Likes