Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create a spline by setting the length between to fit points

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ione_ianniruberto
181 Views, 2 Replies

Create a spline by setting the length between to fit points

Hi everyone, 

I have a problem. I want to create a spline using this code:

 

        design = adsk.fusion.Design.cast(app.activeProduct)
        Features = adsk.fusion.Features.cast(app.activeProduct)
        rootComp = design.rootComponent
 
        points = adsk.core.ObjectCollection.create()
        points.add(adsk.core.Point3D.create(0, 0, 0))
        points.add(adsk.core.Point3D.create(10, 20, 30))
        points.add(adsk.core.Point3D.create(20, 40, 60))
        points.add(adsk.core.Point3D.create(30, 60, 90))
        
        points = adsk.core.ObjectCollection.create()
        points.add(adsk.core.Point3D.create(0, 0, 0))
        points.add(adsk.core.Point3D.create(10, 20, 30))
        points.add(adsk.core.Point3D.create(20, 40, 60))
        points.add(adsk.core.Point3D.create(30, 60, 90))
        
        sketchnurb = rootComp.sketches.add(rootComp.xYConstructionPlane)
        spline = sketchnurb.sketchCurves.sketchFittedSplines.add(points)
 
But then i want to set the length of the spline between to consecutive points to a specific value. How can I do? 
 
Thanks so much 
 
2 REPLIES 2
Message 2 of 3

There isn't a way to specify the length of the spline. The only way to control the length is to modify the position of the fit points. The closer they are to a straight line, the closer the length of the spline will be to a line that goes directly between the two endpoints. Moving the intermediate points will cause the length to be longer. It would be trial and error to get a specific length.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3

Ok, thanks for your answer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report