.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MultiLeader - Select 1 leader

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
C_Witt
659 Views, 8 Replies

MultiLeader - Select 1 leader

I'm trying to create a prompt that lets the user select 1 leader in a multileader.  I know this can be done manually when holding Ctrl, but I need a way to do this in code so i can offer a custom selection of arrow heads for use.

 

I've got some Subenity selection code (modified from here https://forums.autodesk.com/t5/net/nested-entity-or-subentity/td-p/2650802), but that returns everything as "geometry".

 

Can someone show me how to access the leader as a leader so I can change the arrow block?

 

Thanks

8 REPLIES 8
Message 2 of 9
moogalm
in reply to: C_Witt

Hi there,

 

Sorry SubEntity selection will not work on MLeaders, to change the arrow head you need index of that leader line , as far as I know there is no direct API to get leader line index from user prompt selection.

 

May be others can come with any hacks\tricks.

Message 3 of 9
C_Witt
in reply to: moogalm

I can't figure out how to select a leader even if i know the index..?

 

All the index properties take & return an index..  How do you use the index to return the leader?

Message 4 of 9
moogalm
in reply to: C_Witt

 Hi ,

 

You may try this API MLeader.SetArrowSymbolId 

Sets the arrow head symbol id for the specific leaderline, BTW symbolId is the object id of the block value returned DIMBLK variable.

 

 

Message 5 of 9
C_Witt
in reply to: moogalm

Hm, wasn't thinking along thoes lines..  That works, Thanks.

 

Now if only I could get the selected index from the user Smiley Frustrated

Message 6 of 9
C_Witt
in reply to: moogalm

I haven't tried to code this out yet, so let me know if I'm barking up the wrong tree?

 

- have user select Mleader

- have program cycle through leaders 1 at a time changing the color/linetype "highlighting it" and prompt user "Change this one?", if no, go to next

- Once user responds "yes", offer arrow selection and use the set method you mentioned before to change the block

 

?

Message 7 of 9
moogalm
in reply to: C_Witt

I feel your idea seems to be doable ,you can give a try. Good luck 🙂

Make sure not to prompt user from any event handlers ,it only worsens AutoCAD and results  will be strange.

Message 8 of 9
C_Witt
in reply to: moogalm

It's not perfect, but it does get the job done.

 

Thanks.

Message 9 of 9
moogalm
in reply to: C_Witt

That seems to be doable, you can give a try , good luck 🙂

-Madhu
(Sent from iPhone, excuse my brevity and/or typos)

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost