Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fusion 360 equation driven curve API example
# For more details see:
import adsk.core, adsk.fusion,, traceback, math
def run(context):
ui = None
app = adsk.core.Application.get()
ui = app.userInterface
design = app.activeProduct
# Get the root component of the active design.
rootComp = design.rootComponent
# Create a new sketch on the xy plane.
sketches = rootComp.sketches
xyPlane = rootComp.xYConstructionPlane
sketch = sketches.add(xyPlane)
points = adsk.core.ObjectCollection.create() # Create an object collection for the points.
# Enter variables here. E.g. E = 50
startRange = 0 # Start of range to be evaluated.
endRange = 2*math.pi # End of range to be evaluated.
splinePoints = 100 # Number of points that splines are generated.
# WARMING: Using more than a few hundred points may cause your system to hang.
i = 0
while i <= splinePoints:
t = startRange + ((endRange - startRange)/splinePoints)*i
xCoord = (math.sin(2*t))
yCoord = (math.sin(3*t))
zCoord = (2**t)
i = i + 1
#Generates the spline curve
# Error handeling
if ui:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment