Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MLeader Setting using VLisp

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
541 Views, 10 Replies

MLeader Setting using VLisp

Hi,

I'm trying to put the close filled arrow to a MLeader style using VLisp, but
it doesn't take it. I can put easily all other arrow types but not this one.


(setq DICTIONNAIRE_LEADERS (vla-item (vla-get-dictionaries
*ACTIVE_DOCUMENT*) "ACAD_MLEADERSTYLE"))

(setq NOUVEAU_LEADER_STYLE (vlax-invoke DICTIONNAIRE_LEADERS 'addobject
MLeaderName "AcDbMLeaderStyle"))

To put the closed filled arrow, I tried :

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol ".")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_.")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "ClosedFilled")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_ClosedFilled")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol 0)

What else....

If I try (vlax-get NOUVEAU_LEADER_STYLE 'ArrowSymbol) to get the arrow
style while CloseFilled is current, AutoCAD gives me empty quotes "".

Thanks,

Marcel
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

I am also working on MLeaders
How do you change the ArrowSymbol of a select Mleader?
How do you set a MleaderStyle active?


"Marcel Goulet" wrote in message
news:6025698@discussion.autodesk.com...
Hi,

I'm trying to put the close filled arrow to a MLeader style using VLisp, but
it doesn't take it. I can put easily all other arrow types but not this one.


(setq DICTIONNAIRE_LEADERS (vla-item (vla-get-dictionaries
*ACTIVE_DOCUMENT*) "ACAD_MLEADERSTYLE"))

(setq NOUVEAU_LEADER_STYLE (vlax-invoke DICTIONNAIRE_LEADERS 'addobject
MLeaderName "AcDbMLeaderStyle"))

To put the closed filled arrow, I tried :

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol ".")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_.")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "ClosedFilled")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "_ClosedFilled")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol "")

(vlax-put NOUVEAU_LEADER_STYLE 'ArrowSymbol 0)

What else....

If I try (vlax-get NOUVEAU_LEADER_STYLE 'ArrowSymbol) to get the arrow
style while CloseFilled is current, AutoCAD gives me empty quotes "".

Thanks,

Marcel
Message 3 of 11
kudzuman
in reply to: Anonymous

I can't find an answer to this anywhere. There is a similar problem in .NET and there is an answer to that in the comments by Greg at http://through-the-interface.typepad.com/through_the_interface/2007/01/creating_an_aut.html

with 

ld.Dimldrblk = ObjectId.Null;

 

But, for VLisp...?

Tried setting ArrowSymbol to the above plus:

.
"closed filled"
nil
null
:vlax-null

What's the magic word here?

 

I want to fix any standard mleader styles in the drawing to company standards in case they were tampered with.

If there is no answer, then I guess I will have to make a custom block that looks like the default "closed filled" one and use that instead.

Message 4 of 11
hmsilva
in reply to: kudzuman

try

 

(vla-put-arrowheadtype obj 0)

 

Henrique

EESignature

Message 5 of 11
kudzuman
in reply to: hmsilva

That gives this:

; error: ActiveX Server returned the error: unknown name: ArrowheadType

Message 6 of 11
hmsilva
in reply to: kudzuman

try, and tell me what's the result, for me have the desired result

 

(defun c:test (/ obj)
  (vl-load-com)
  (setq
    obj	(vlax-ename->vla-object
	  (car (entsel "\nSelect arrow to change to closed filled: "))
	)
  )
  (vla-put-arrowheadtype obj 0)
  (vla-update obj)
  (princ)
)

 Henrique

EESignature

Message 7 of 11
kudzuman
in reply to: hmsilva

That puts an override on that 1 instance of a mleader but does not change the mleader style. I want to change the style so all mleaders of that style update plus any new mleaders of that style get the closed filled arrow.

Message 8 of 11
hmsilva
in reply to: kudzuman

kudzuman,

weird, I also get error for mleader style... "Key not found"...

 

Henrique

EESignature

Message 9 of 11
kudzuman
in reply to: hmsilva

That's what I get. vlax-get-property returns "" so you would think you could just use "" with vlax-put-property, but nooooo! (said in John Belushi voice). 3 people getting the same thing... must be a bug.

Message 10 of 11
hmsilva
in reply to: kudzuman

kudzuman wrote:

That's what I get. vlax-get-property returns "" so you would think you could just use "" with vlax-put-property, but nooooo! (said in John Belushi voice). 3 people getting the same thing... must be a bug.

 

kudzuman,

I kept trying to find a solution to this problem, with some friends and in other forums, and the feedback was always the same,

"the arrowsymbol property, must take the value of a block defined in the drawing"

Iif you set the arrowsymbol to another different symbol it will become automatically defined as block in the drawing, but with the Closed Filled, it does not...

So, the work around is, create a block similar to Closed Filled and set the arrowsymbol to the new block...

 

hope that helps

Henrique

EESignature

Message 11 of 11
kudzuman
in reply to: hmsilva

Thanks for looking into this Henrique. That is the same answer I keep coming to.

However I still think it is a bug or design flaw that you cannot set via vlisp the mleader ArrowSymbol property to a valid value ("" or null) that is available through the regular AutoCAD interface. Do you have to be an ADN member to submit problems with vlisp? If so, can someone submit this for me since I am not an ADN member?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost