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: 

Can an add-in be notified about changes in the design?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
toby_allsopp
258 Views, 4 Replies

Can an add-in be notified about changes in the design?

I would like my add-in to be able to react to changes in the design, for example if a component is added/removed or the geometry or appearance changes - is there an event that I can add a handler for? (I'm using the C++ API).

4 REPLIES 4
Message 2 of 5
kandennti
in reply to: toby_allsopp

Hi @toby_allsopp .

 

Fusion360 has commands being called for many operations.


When a command is executed, the UserInterface.commandTerminated event is fired.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-E381414E-1CFF-4007-B1DF-C413D7E6841A 

Message 3 of 5
toby_allsopp
in reply to: kandennti

Thank you, @kandennti!

 

If I understand correctly, the commandTerminated event will fire whenever the user does pretty much anything in the UI. How can I tell, in my event handler, what was actually changed? It looks like the event args include a command ID and a command definition. Would I need to look at the command ID to figure out what the command did? Is there a list of built-in commands somewhere? 

Message 4 of 5
kandennti
in reply to: toby_allsopp

@toby_allsopp .

 

As for the shape, why not check the values of modelParameter and userParameter?

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-d037893e-b36f-448f-b693-d0fe7aaee778 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-ba26f8cd-6136-44a8-81fe-b133198cfa2d 


I don't know, but maybe it is enough to check the center of gravity using the getPhysicalProperties method of the root component.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-3EA1D5C8-B79A-4FC0-A130-DED8D8F45D8A 

 

As for the appearance, I think it would be difficult since all aspects need to be checked.

 

 

If you simply need to check the FusionDocument.isModified property, that would be the easiest way.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c6a12e58-712b-4a8d-83f5-ad9504744e46

Message 5 of 5
toby_allsopp
in reply to: kandennti

Thank you for the info. It seems like I will need to store the information I depend on and then compare the state of it when a modification is detected.

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

Post to forums  

Autodesk Design & Make Report