Highlight set

Highlight set

NachoShaw
Advisor Advisor
1,149 Views
4 Replies
Message 1 of 5

Highlight set

NachoShaw
Advisor
Advisor
Hi

I have a routine that allows the user to select a part and then that part gets copied multiple times into the same assembly. These parts are likely placed into the assembly to allow positioning and that is done by a mouse click.

I have created a highlight set to highlight all of the parts until the routine ends however, it's not working correctly. What happens is:

The initial part highlights when selected
The copied part highlights, the original parts unhighlights
The copied part highlights, the previous copied part dehighlights and so on. I can only get 1 part to highlight at any one time. There isn't any code cancelling the highlight set.

How can I retain the highlight set until I no longer need it?


Cheers

Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Accepted solutions (1)
1,150 Views
4 Replies
Replies (4)
Message 2 of 5

bshbsh
Collaborator
Collaborator

@nmjshaw150 wrote:
There isn't any code cancelling the highlight set.

I've had an issue with this too. The HLS was cleared as soon as I ran an internal command via the command manager - don't know why. If you're using an internal command to select components (such as Pick), it may be the same case.

I guess if this is the case, then you would have to add your selected component to a permanent ObjectCollection and then recreate the HLS every time after the internal command finished? Just guessing.

0 Likes
Message 3 of 5

Anonymous
Not applicable
0 Likes
Message 4 of 5

ekinsb
Alumni
Alumni
Accepted solution

Highlighting is somewhat fragile and changes to the model will typically clear any current highlighting.  I would suggest saving a list of the objects you want to highlight and then re-create the highlight after you've done all of the changes.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 5 of 5

NachoShaw
Advisor
Advisor

Hi

 

I managed to get it working ok. I moved the call to add objects to the highlight collection to the end. I also added in a secondary object collection and iterated through that to do the final highlight. it all works fine 🙂

 

 

Cheers

 

Nacho

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes