Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

My CustomGraphicsGroup disappears after confirming a messagebox

2 REPLIES 2
Reply
Message 1 of 3
nraynaud
194 Views, 2 Replies

My CustomGraphicsGroup disappears after confirming a messagebox

Hi all, 

 

I might be misunderstanding CustomGraphicsGroup life cycle. I created a Command, when the command is created, I create a CustomGraphicsGroup and draw on it. But at various times my CustomGraphicsGroup disappears from the display.

 - if I confirm a messagebox()

 - if I change the visibility of a body

 - if I change the visibility of the origin (here is a demo: http://recordit.co/ussDOdkA6P the red lines are on the custom graphics)

Even if the graphics is not visually displayed, it's still in the collection of customGraphicsGroups, and its properties isVisible and isValid are still true.

 

There are no events for me to understand the expected life cycle, I am a bit puzzled. My intended behavior was that the graphics would be here until I remove it, and that I would add and remove objects from it to change its appearance, and delete it altogether when I'm done with it.

 

Thanks for your help.

 

Nicolas.

 

2 REPLIES 2
Message 2 of 3
nraynaud
in reply to: nraynaud

Upon further investigation, my graphic group has been emptied, its count has fallen to zero after it became invisible.

I still don't know why.

 

Thanks for your help.

Message 3 of 3
nraynaud
in reply to: nraynaud

After a bit of soul searching it's about the life cycle and transactions.

 

I did my display changes in the InputChanged event, but they have to go into the Preview event.

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