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
Solved! Go to Solution.
Solved by moogalm. Go to Solution.
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.
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?
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.
Hm, wasn't thinking along thoes lines.. That works, Thanks.
Now if only I could get the selected index from the user
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
?
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.