Scripting and the API#
This section covers automating and extending Fusion with Python and C++ scripts and add-ins, and connecting to the cloud through Autodesk Platform Services. It starts with the API overview, the Scripts and Add-Ins dialog and a first Python script, then the object model.
The practical pages cover creating sketches and features, working with parameters, event handlers and custom events, building UI with commands, toolbars and palettes, debugging in VS Code, C++ API notes, and packaging and distributing add-ins. A final page covers Autodesk Platform Services and Fusion automation. It suits users who can read code; the first script page is for beginners.
Pages in this section#
- Fusion API Overview (intermediate): What the Fusion API is, which languages and modules it offers.
- Scripts and Add-Ins Dialog, and Your First Python Script (beginner): Use the Scripts and Add-Ins dialog, create a new Python script from the template.
- The API Object Model (intermediate): How Application, Document, Product, Design, Component, Occurrence, Sketch and Feature objects relate.
- Creating Sketches and Features with the API (intermediate): Create sketches, curves, constraints and dimensions, then extrude.
- Working with Parameters in the API (intermediate): Read, create, edit and delete user and model parameters from Python.
- Building UI: Commands, Toolbars and Palettes (advanced): Create command definitions, add buttons to toolbar panels.
- Event Handlers and Custom Events (advanced): Subscribe to application, document, workspace and command events.
- Debugging Scripts and Add-Ins in VS Code (intermediate): Attach Visual Studio Code to Fusion, set breakpoints.
- Packaging and Distributing Add-Ins (advanced): Structure an add-in project, write the manifest, handle resources.
- C++ API Notes (advanced): When to choose the Fusion C++ API over Python.
- Autodesk Platform Services and Fusion Automation (advanced): Authenticate with APS, browse Fusion data with Data Management.
Before you start#
Which license types may use the API, and whether Personal-use limits affect scripts or cloud services, is not stated; check your license terms before building a commercial tool.
Confirmed vs not confirmed#
The APS page is largely general APS knowledge, not from the Fusion help: its endpoints, OAuth flows, scopes, quotas and pricing are not confirmed in Autodesk's Fusion documentation, so verify them against current APS documentation. Also not confirmed: an application exit event, the contents of generated launch.json, and the App Store bundle layout and review process.