Learn Fusion360-scripting - 10 Code Examples & CST Typing Practice Test
Fusion 360 Scripting allows users to automate design tasks, create custom tools, and extend functionality within Autodesk Fusion 360 using Python or JavaScript (TypeScript) APIs, enabling parametric modeling, simulation, and manufacturing workflow automation.
Learn FUSION360-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
Create New Document (Fusion 360)
import adsk.core, adsk.fusion, adsk.cam, traceback
app = adsk.core.Application.get()
design = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
Opens a new Fusion 360 design document via API.
Create a Sketch on XY Plane
rootComp = design.rootComponent
xyPlane = rootComp.xYConstructionPlane
sketch = rootComp.sketches.add(xyPlane)
Adds a new sketch on the XY plane.
Draw a Line in Sketch
lines = sketch.sketchCurves.sketchLines
line = lines.addByTwoPoints(adsk.core.Point3D.create(0,0,0), adsk.core.Point3D.create(5,0,0))
Draws a line in the active sketch between two points.
Draw a Circle in Sketch
circles = sketch.sketchCurves.sketchCircles
circle = circles.addByCenterRadius(adsk.core.Point3D.create(0,0,0), 5)
Creates a circle in a sketch by specifying center and radius.
Extrude Sketch Profile
prof = sketch.profiles.item(0)
extrudes = rootComp.features.extrudeFeatures
extInput = extrudes.createInput(prof, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
extInput.setDistanceExtent(adsk.core.ValueInput.createByReal(10), adsk.fusion.ExtentDirections.PositiveExtentDirection)
extrudes.add(extInput)
Extrudes a sketch profile to create a 3D solid.
Create a Rectangle Sketch
lines = sketch.sketchCurves.sketchLines
l1 = lines.addByTwoPoints(adsk.core.Point3D.create(0,0,0), adsk.core.Point3D.create(5,0,0))
l2 = lines.addByTwoPoints(adsk.core.Point3D.create(5,0,0), adsk.core.Point3D.create(5,3,0))
l3 = lines.addByTwoPoints(adsk.core.Point3D.create(5,3,0), adsk.core.Point3D.create(0,3,0))
l4 = lines.addByTwoPoints(adsk.core.Point3D.create(0,3,0), adsk.core.Point3D.create(0,0,0))
Draws a rectangle using four sketch lines.
Apply Fillet to Edge
edges = rootComp.bRepBodies.item(0).edges
fillets = rootComp.features.filletFeatures
filletInput = fillets.createInput()
filletInput.addConstantRadiusEdgeSet(adsk.core.ObjectCollection.create(edges), adsk.core.ValueInput.createByReal(2), True)
fillets.add(filletInput)
Applies a fillet to a selected edge of a body.
Move Body
body = rootComp.bRepBodies.item(0)
matrix = adsk.core.Matrix3D.create()
matrix.translation = adsk.core.Vector3D.create(10, 5, 0)
moveFeats = rootComp.features.moveFeatures
moveInput = moveFeats.createInput(adsk.core.ObjectCollection.create([body]), matrix)
moveFeats.add(moveInput)
Translates a body along X, Y, Z axes.
Create Circular Pattern
axis = rootComp.zConstructionAxis
features = rootComp.features
feat = features.item(0)
patternFeats = rootComp.features.circularPatternFeatures
patternInput = patternFeats.createInput(adsk.core.ObjectCollection.create([feat]), axis, 6, adsk.core.ValueInput.createByString('360 deg'))
patternFeats.add(patternInput)
Creates a circular pattern of a feature around an axis.
Save Design Document
design.saveAs('C:/Users/Public/Documents/Fusion360/part1.f3d', '')
Saves the current design document to a file.
Frequently Asked Questions about Fusion360-scripting
What is Fusion360-scripting?
Fusion 360 Scripting allows users to automate design tasks, create custom tools, and extend functionality within Autodesk Fusion 360 using Python or JavaScript (TypeScript) APIs, enabling parametric modeling, simulation, and manufacturing workflow automation.
What are the primary use cases for Fusion360-scripting?
Automating repetitive modeling tasks. Custom parametric design generation. Batch exporting or processing designs. Automating CAM toolpath generation. Creating custom UI commands and add-ins
What are the strengths of Fusion360-scripting?
Rapid automation of repetitive CAD/CAM tasks. Highly flexible with Python scripting. Direct access to Fusion 360 API objects. Supports parametric design automation. Integrates seamlessly with Fusion 360 workflows
What are the limitations of Fusion360-scripting?
Only works within Fusion 360 environment. Python API may have limitations compared to full desktop APIs. Performance can be slower for extremely large assemblies. UI customization is limited to Fusion 360 add-in framework. Requires knowledge of Fusion 360 object model and API
How can I practice Fusion360-scripting typing speed?
CodeSpeedTest offers 10+ real Fusion360-scripting code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.