TypeScript
The application programming interface (API) of Fusion allows you to author Scripts and Add-Ins to automate workflows in Fusion. The desktop client of Fusion can execute scripts and Add-Ins that are written in Python or C++.
Scripts for Design Automation for Fusion can only be written in TypeScript. Design Automation for Fusion will not support Python or C++ scripts. This page lays out the similarities and differences between the existing API languages and the TypeScript API and explain to you how develop scripts for the Fusion engine on Design Automation.
Local Development and Debugging with the Design Automation for Fusion TypeScript Add-In
You can develop, debug and execute TypeScript scripts with the Design Automation for Fusion Add-In.
Install and setup the Design Automation for Fusion Add-In:
- Download the zip package and unpack it to %APPDATA%/Autodesk/Autodesk Fusion 360/API/AddIns for windows or ‘Users/USERNAME/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts for Mac
- Open Fusion and navigate to the Scripts and Add-Ins command under Utilities -> Add-Ins
- Find and run the “Design Automation for Fusion Add-in”, ideally check “Run on Startup”
- Under Utilities -> Add-Ins run the “DA4F” command
The usage of the Design Automation for Fusion Add-In is described here.
The reference documentation of the TypeScript API can be accessed from within the Design Automation for Fusion-Add-In. It outlines the classes and methods available in the TypeScript API.
API Restrictions
Most of the API classes and method that are available in the desktop client of Fusion in C++ and Python are available through Design Automation for Fusion, with the following restrictions:
- Most of the methods of the UserInterface class are unavailable for Design Automation for Fusion.
- Most classes and methods that require interactive user input, or create UI dialogs are unavailable.
- Custom events, custom graphics and text commands are unavailable.
- The API of the Render environment is unavailable.
- Local file access through the TypeScript API is restricted to the working directory of the Script.
- You cannot import third party packages via npm or outher package management systems.