Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been hanging out for the new SketchFixedSplines.addByNurbsCurve method all year, and it's looking tantalizingly close!! It says
Introduced in version October 2020But my Fusion360 version says
2.0.9011So I assume that's September? How do I get October??
I did try to see if it works - but no luck:
I'm hoping to do stuff like this:-
(adapted from this awesome link)
Here's my code:-
#Author-Chris Drake
#Description-Testing if the API can create control splines
import adsk.core, adsk.fusion, adsk.cam, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
ui.messageBox('Hello script')
design = app.activeProduct
rootComp = design.rootComponent
sketches = rootComp.sketches
sketch = sketches.add(rootComp.xYConstructionPlane)
sketchCurves = sketch.sketchCurves
knots = [ 0,0,0,0, 1,1,1,1 ]
degree = 3
P0 = adsk.core.Point3D.create(0, 0, 0)
P1 = adsk.core.Point3D.create(1, 0, 0)
P2 = adsk.core.Point3D.create(1, 1, 0)
P3 = adsk.core.Point3D.create(0, 1, 0)
controlPoints = [ P0,P1,P2,P3 ]
#sketchCurves.sketchFixedSplines.addByNurbsCurve( adsk.core.NurbsCurve3D.createNonRational(controlPoints, degree, knots, False )) # Fails 2020-10-18
sketchCurves.sketchFittedSplines.addByNurbsCurve( adsk.core.NurbsCurve3D.createNonRational(controlPoints, degree, knots, False )) # Semi-works (breaks if user edits)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.