Modify mleader arrowhead with vlisp

Modify mleader arrowhead with vlisp

spykat
Advocate Advocate
801 Views
10 Replies
Message 1 of 11

Modify mleader arrowhead with vlisp

spykat
Advocate
Advocate

On rare occasions I need to modify the arrowhead on a mleader. I've done it before but I cannot find my old code.

I can use:

(command "Mleader" pt5 pt6 "" answr)
(setq ent (ssname (ssget "L") 0))
(setq ldrobj (vlax-ename->vla-object ent))
(vla-put-arrowheadsize ldrobj 6.0)

and change the size, but I need to change arrowhead symbol from Closed filled to Dot blank.

Any ideas?

0 Likes
Accepted solutions (1)
802 Views
10 Replies
Replies (10)
Message 2 of 11

spykat
Advocate
Advocate
Accepted solution

Never mind, I figured it out

0 Likes
Message 3 of 11

ronjonp
Advisor
Advisor

@spykat 

You can modify that in the properties palette. Better yet make an mleaderstyle that has DotBlank as the arrowhead.

0 Likes
Message 4 of 11

ronjonp
Advisor
Advisor

@spykat wrote:

Never mind, I figured it out


Here's what I found works .. although I'd still manage this by styles and mleaderscale variable.

 

(command "_.Mleader" (getpoint) (getpoint) "")
(setq ent (entlast))
(setq ldrobj (vlax-ename->vla-object ent))
(vla-put-Arrowheadtype ldrobj 12)
(vla-put-arrowheadsize ldrobj 6.0)

 

 

0 Likes
Message 5 of 11

spykat
Advocate
Advocate

I just didn't want to add the step of changing it in the properties palette or to have to create a mleaderstyle just for 1 or 2 leaders in 1 out of 50 drawings.

 

I used (vla-put-ArrowheadBlock ldrobj "_DotBlank")

I was missing the underscore

0 Likes
Message 6 of 11

ronjonp
Advisor
Advisor

You might test that. I opened a blank drawing, inserted a leader and tried the method you're using and it threw an error (; error: Automation Error. Key not found ) because the block was not yet defined in the drawing. Documentation HERE.

I'd recommend: 

(vla-put-Arrowheadtype ldrobj acArrowDotBlank)
0 Likes
Message 7 of 11

spykat
Advocate
Advocate

I tried that too and it still works. Dot blank is one of the default dimension blocks. I've never had to define it in a drawing in the past

0 Likes
Message 8 of 11

ronjonp
Advisor
Advisor

@spykat wrote:

I tried that too and it still works. Dot blank is one of the default dimension blocks. I've never had to define it in a drawing in the past


Weird. I can consistently replicate what I described above. Perhaps you're pulling from a template that already has it defined.

ronjonp_0-1682978471149.png

It always works with the method I proposed.

 

0 Likes
Message 9 of 11

spykat
Advocate
Advocate

I'm not using a template. I defined a text style and mleader style that was set to closed filled.

0 Likes
Message 10 of 11

ronjonp
Advisor
Advisor

@spykat wrote:

I'm not using a template. I defined a text style and mleader style that was set to closed filled.


Good for you. Glad you figured it out for yourself. 👍

0 Likes
Message 11 of 11

Sea-Haven
Mentor
Mentor

For anyone count from top to bottom, Blankdot is 12.

SeaHaven_0-1683003712468.png

 

0 Likes