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: 

Parameter changes with following snapshots

Message 1 of 5
342 Views, 4 Replies

Parameter changes with following snapshots




I have created a model in the Fusion 360. By changing one of the parameters (dimension constraint), in my case an angle, the geometrical model will of cause also alter its shape. The angle has to be changed in the range (Min_Angle – Angle – Max_Angle) with the increment, Angle_Increment. After each parameter-change, a snapshot has to be taken of the updated geometry of the CAD-model. Each name of the snapshot-file has to be assigned with a name extended with the specific angle, e.g. Name_Angle, in order to secure that we know in which order of sequence the snapshots have been taken.



The snapshots will then be imported and shown in sequence as a stream in e.g. Movie Maker or VLC. These programs also has functions for saving these discrete snapshots into an xxx.mp4 file. The created xxx.mp4 file will then show the geometry change of the model as a small video film.



I have already tested it and it work absolutely fine and it is very educating to se such geometry-change as a function of a parameter in ”pseudo” real-time. However, to manually change the angle (or parameters, if several) from the ”Change Parameter” window with a following manually taken snapshot with the Fusion 360 snapshot feature is a very time-consuming process and is only feasible for a very limited number of parameter changes, resulting in a very low resolution video. An even more unrealistic situation will arise if there also is a need for making modification and contributions to the CAD-model. This in turn will lead to a need to start over the entire process from the beginning again.



Therefore, there is a need for a Python Script capable of performing all this work. Unfortunately, my skills in this scripting and API are, at the moment, too limited and therefore unable to create such a code. Perhaps anybody know if such a code exists or if Fusion 360 is able to perform this task. I know that the ”Animation” modules has functions for mutual motion between components. However, in this case I do not think that works.




Best Regards



Message 2 of 5
in reply to: Peter__B



We had API to change parameter and capture snapshot of a viewport. I am not sure if they can meet your requirements. Please refer to the following codes. I create a box(70x80x30) in viewport and save it as image file with 800x600 and then change height of box into 50 mm and save it as image file again.






import adsk.core, adsk.fusion,, traceback

def run(context):
    ui = None
        app = adsk.core.Application.get()
        ui  = app.userInterface
        design = adsk.fusion.Design.cast(app.activeProduct)
        root = design.rootComponent
        app.activeViewport.saveAsImageFile('/Users/tum/Downloads/1.png', 800, 600)
        root.modelParameters.itemByName('d3').expression = '50 mm'
        app.activeViewport.saveAsImageFile('/Users/tum/Downloads/2.png', 800, 600)

        if ui:





Marshal Tu
Fusion 360 Developer
Autodesk, Inc.

Message 3 of 5
in reply to: marshaltu

Hi Marshal


Thanks a lot, I will try to use those lines.




Message 4 of 5
in reply to: Peter__B

Hi all


I have made some progress in my attempt to make a mp4 movie created by snapshot of my CAD geometry for a large number of an angle in my model. I would therefore like to share this information here on the Community.


To manually perform the steps that I had addressed earlier would be an enormous work and impossible to perform even if each step in this process is rather short. Even more job will be added when the model continuously will be modified. Each "angle sweep" includes about 300-500 snapshots that has to be saved with a correct and traceable names. The work would be almost impossible to perform without mistakes and also very time-consuming but a perfect job for a Python Script.


However, I found a Python Script under Programming Interface/Sample Programs/General/Miscellaneous/Create Animation. This Python Script is able to perform all the tasks that I need and works perfect.


Best Regards


Message 5 of 5
in reply to: Peter__B

Here's a direct link to the sample Peter mentioned.


You might also want to take a look at this:

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