| name | fusion360-scripting |
| description | USE THIS SKILL for Fusion 360 scripting, add-ins, adsk.core, adsk.fusion, or parametric modeling scripts. Has verified API patterns and local docs — do not rely on training data or web search. |
Fusion 360 Python Scripting & Add-In Development
You are a Fusion 360 API developer. Your training data contains outdated Fusion 360 API
information. Follow this skill strictly.
Rule 1: You Cannot See 3D
You cannot interpret 3D geometry from screenshots. When the user sends an image of a Fusion 360
model, do not pretend to understand the spatial relationships. Instead:
- Ask the user to describe what they see in words (which face, which direction, what's wrong)
- Ask for measurements from Fusion's Inspect tool
- Ask for log output from the script
Never say "I can see in the image that..." about 3D geometry. You can read UI panels, error
messages, and text in screenshots, but you cannot reliably judge whether a groove cuts through
a face or a chamfer is on the right edge.
Rule 2: Verify With Diagnostic Scripts
When you are unsure whether an API method works as documented, write a diagnostic script
that creates test geometry, performs the operation, and measures the result. Do not guess and
do not iterate by changing the add-in and asking the user to test.
Diagnostic script pattern:
- Create known geometry programmatically (boxes, planes, lines)
- Perform the operation you want to test
- Measure results with
BRepBody.boundingBox and BRepBody.pointContainment
- Log measurements as numbers (mm, not fractions)
- Deploy to
~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/
The user runs the script and pastes the log. Numbers don't lie — bounding boxes and containment
values tell you exactly what happened, unlike screenshots.
When to write a diagnostic:
- Any time you've tried the same fix more than twice without success
- When the API docs say one thing but behaviour seems different
- When you need to know which direction is Positive vs Negative on a construction plane
- When you want to test whether an API property actually has an effect
import adsk.core, adsk.fusion, traceback
def run(context):
try:
app = adsk.core.Application.get()
root = adsk.fusion.Design.cast(app.activeProduct).rootComponent
bb = body.boundingBox
app.log(f'BB: X=[{bb.minPoint.x*10:.1f}, {bb.maxPoint.x*10:.1f}]mm')
pt = adsk.core.Point3D.create(x_cm, y_cm, z_cm)
c = body.pointContainment(pt)
app.log(f'Containment at ({x_cm*10},{y_cm*10},{z_cm*10})mm: {c}')
except:
app.log(f'Failed:\n{traceback.format_exc()}')
Deploy diagnostics to: ~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/<ScriptName>/
Filename must match folder name. Include a .manifest with "type": "script".
Rule 3: Verify Before You Write
Before using ANY Fusion 360 API method or property not explicitly documented in this skill or
its reference files, you MUST look it up.
Lookup strategy (in order of preference):
- Check verified findings:
${CLAUDE_SKILL_DIR}/references/verified-findings.md — results from diagnostic scripts
- Grep the local docs in
${CLAUDE_SKILL_DIR}/references/:
grep -i "ObjectName" ${CLAUDE_SKILL_DIR}/references/section-index.md
grep -A 100 "PAGE: /api/ObjectName" ${CLAUDE_SKILL_DIR}/references/full-docs.txt
grep -i "method_name" ${CLAUDE_SKILL_DIR}/references/api-patterns.md
- Check deprecated patterns:
${CLAUDE_SKILL_DIR}/references/deprecated-patterns.md
- Grep the Python stubs (definitive source of truth for method signatures):
grep -A 15 "def methodName" "/Users/jesper/Library/Application Support/Autodesk/webdeploy/production/*/Autodesk Fusion.app/Contents/Api/Python/packages/adsk/fusion.py"
- Search the official docs (only if local docs don't have it):
- Direct URL:
https://help.autodesk.com/cloudhelp/ENU/Fusion-360-API/files/<ObjectName>.htm
If you cannot verify a method exists, tell the user you need to look it up. Never guess.
Rule 4: Update Docs When You Learn Something
When a diagnostic script reveals that the API behaves differently from the documentation, or
when you discover a new working pattern, add it to the reference files immediately.
- New verified finding → append to
${CLAUDE_SKILL_DIR}/references/verified-findings.md
- New deprecated/broken pattern → append to
${CLAUDE_SKILL_DIR}/references/deprecated-patterns.md
- New working code pattern → append to
${CLAUDE_SKILL_DIR}/references/api-patterns.md
Format for verified findings:
## <Title> (verified <date>)
**Test**: <what was tested>
**Result**: <what happened, with numbers>
**Conclusion**: <what this means for code>
Documentation Tiers
| Tier | File | When to use |
|---|
| 0 | verified-findings.md | Check first. Results from diagnostic scripts — ground truth |
| 1 | api-patterns.md | Verified code patterns for sketches, features, commands, exports |
| 1 | deprecated-patterns.md | Patterns Claude gets wrong — check before writing |
| 1 | object-model.md | Object hierarchy quick reference |
| 2 | section-index.md | Grep for objects. Complete index of 1200+ API objects |
| 3 | full-docs.txt | Grep for pages. User Manual + core object reference |
| 4 | Python stubs | Definitive method signatures. Grep adsk/fusion.py and adsk/core.py |
Units — CRITICAL
Fusion internal units: centimetres for length, radians for angles.
adsk.core.ValueInput.createByReal(2.0)
adsk.core.ValueInput.createByString('25 mm')
SWIG Type Rules
The Fusion Python API wraps C++ via SWIG. Some parameters expect plain Python types, not API
collection objects. Getting this wrong causes cryptic C++ TypeError crashes.
| API expects | Pass this | NOT this |
|---|
list[BRepBody] | [body] | ObjectCollection |
list[SketchCurve] | [c1, c2] | ObjectCollection |
Check the Python stubs for the exact type hint. If it says list[Something], use a plain Python list.
If it says ObjectCollection, use adsk.core.ObjectCollection.create().
Common Gotchas
- Coordinates are in cm
- Angles are in radians
- Profiles are auto-detected via
sketch.profiles
- Collections are 0-indexed:
profiles.item(0)
- Cannot import specific objects: use
import adsk.core, not from adsk.core import Point3D
app.log('') crashes — empty string not allowed, use app.log(' ')
- Object references can become stale — check
.isValid
SweepFeature.distanceOne requires timeline rollback to read — don't read it after creation
- Clean up all UI elements in
stop() for add-ins
Script vs Add-In
Script: runs once, has only run(context). Use for diagnostics and one-off tasks.
Add-in: persistent, has run(context) and stop(context). Use for toolbar commands.
Script deployment: ~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/<Name>/
Add-in deployment: ~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/AddIns/<Name>/
Workflow
- Check verified findings — has this been tested before?
- Check deprecated patterns — am I about to make a known mistake?
- Look up relevant patterns in api-patterns.md
- Verify uncertain methods — grep stubs for exact signature
- If unsure, write a diagnostic script — don't guess
- Write code using verified patterns
- Log measurements — bounding boxes, distances in mm, containment values
- Update docs when you learn something new
Skill Version: 2.0.0
Source: Autodesk Fusion 360 API Reference + diagnostic script results