Execute Code
execute_codeRun Python code in Fusion 360 to automate CAD tasks; the last expression's value is returned, and optional timeout handles long-running scripts.
Instructions
Run arbitrary Python in Fusion 360. The last expression's value is returned (REPL-style). Pre-defined names: app, ui, design, component, adsk, math, late_results. The add-in waits 30 s by default; pass timeout_s (max 600) for a script that runs many features on a large timeline. A command that times out while running still finishes; its result is kept and late_results() returns it. Unless a parameter says otherwise, lengths and coordinates are in cm (not mm) and angles in degrees.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout_s | No | Seconds to wait for the script (default 30). |