AnsweredAssumed Answered

Attach sketchblockinstance leaders to entities

Question asked by John Alexander on May 29, 2015
Latest reply on Aug 13, 2015 by John Alexander

I have a macro that emulates the behavior of BOM balloons in solidworks 2012 using custom sketch blocks. One piece of functionality that is still missing is the ability to attach leaders from the blocks to the components that they are "linked" to.

 

The blocks are not actually linked to components like with $PRP because I needed the text to wrap inside the balloon and this doesn't seem to be possible in 2012 (In fact, this is the premise of the entire project, otherwise I would just be customizing existing BOM balloon annotations). My solution to linking them is to collect references to every single balloon whenever the macro runs and pair them up with their associated component. The component names are saved as an invisible attribute in the balloon. Whenever the user needs the balloons to update, they hit a button on a form.

 

So I have sketchblockinstances and the components that I want to draw leaders to but I cannot figure out how to actually attach the leaders. The only methods that seem to relate to sketchblockinstance leaders are GetLeaderPoints and GetLeaderStyle. The former only allows me to retrieve information about leader geometry and the latter has nothing to do with the position of the leader. Is there an object that I can cast sketchblockinstances as which will allow me to modify their leaders? Any other options?

 

Failing this, I need a way of ensuring that the component that IS being pointed to by the manually drawn leader is being represented by the balloon. If the user selects one component (A) to generate the balloon and manually attaches the leader to a different component (B), the balloon needs to update according to (B)'s properties. Any ideas are appreciated.

 

Thank you,

John

Outcomes