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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help needed: how to create a workflow similar to native Fusion Operations?

Message 1 of 2
198 Views, 1 Reply

Help needed: how to create a workflow similar to native Fusion Operations?

What I think Fusion typical workflow works like:


1. Interface to input parameters:

I think Fusion has a decent support for that with within ui.commandDefinitions


2. Preview of script execution

It is pretty hard to figure out what you will get from script execution without any sort of preview. I've experimenting creating temporary Components to preview but that's really not intuitive


3. Parametric script execution

I don't know how to make my script part of the timeline. where I could tweak the values and have Fusion running the script in the background without breaking next operations in the time line. Is there any way to do it? For example, SpurGear script - if you want to change the number of teeth later in your design, you cannot go back in the timeline, open the SpurGear parameters and change the number of teeth, and having your entire design changed. I hope I was clear enough with my description as this is one of the most important things I believe lacks in Fusion.


4: Undo

Please make undo undo the entire script execution not every single operation the script made. That is so annoying! Removing the objects sucks, as I always end up with SketchXXX (hundred) numbers after a "few" iterations with my scripts. I would rather try to keep the sequential number that Undos typically bring.



Message 2 of 2
in reply to: gscotti

I think most of what you've asked for is currently available through the command functionality in Fusion. When you create a command you can define a command dialog that contains various inputs to get information from the user.  


There's an event (executePreview) that fires as part of the command framework whenever the user changes any of the input and where you can draw whatever preview you want.  The next time the event is fired, Fusion will automatically remove the previous preview so you can re-draw it with the new data.


The ability to create your own custom features is currently missing.  It's something we've discussed and are planning but is still at an unknown date in the future.


Jack already replied about the undo, but that's also an automatic part of the command machinery.  Any creation you do within a command is grouped into a single transaction and can be undone as a single undo.  You can see this with the Spur Gear sample.

Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog

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