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: 

Sketches on plane along a spline

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

Sketches on plane along a spline

Hi, I have created a plane along a spline like in the figure. Now I want to create a sketch on this plane. I create the circle in the plane and as the center of the circle I want specifically the point of the spline in corrspodence of which the plane has been created. I try to put zero but the code gives the result in the figure. The code that I wrote is this:

spline = sketchnurb.sketchCurves.sketchFittedSplines.add(points)
distance0 = adsk.core.ValueInput.createByReal(0.0)
planeInput.setByDistanceOnPath(spline, distance0)
plane0 = planes.add(planeInput)
sketchplane0 = rootComp.sketches.add(plane0) #PianoVALVE
circleplane0 = sketchplane0.sketchCurves.sketchCircles
               
circle01 = circleplane0.addByCenterRadius(adsk.core.Point3D.create(0,0,0), 0.85)
circle02 = circleplane0.addByCenterRadius(adsk.core.Point3D.create(0,0,0), 1.05)
profilo01 = sketchplane0.profiles.item(0)
profilo02 = sketchplane0.profiles.item(1)

ione_ianniruberto_0-1699101441443.png

I don't know what else to do. Can someone please help me?

Thanks

Ione  

 

 

2 REPLIES 2
Message 2 of 3

For some reason, the origin of the construction plane is not created on the spline. I'm sure there's a reason for this but it's not evident to me.

 

However, there is a workaround. If you replace these lines

 

circle01 = circleplane0.addByCenterRadius(adsk.core.Point3D.create(0,0,0), 0.85)
circle02 = circleplane0.addByCenterRadius(adsk.core.Point3D.create(0,0,0), 1.05)

 

with this

 

circle01 = circleplane0.addByCenterRadius(sketchplane0.modelToSketchSpace(plane0.geometry.origin), 0.85)
circle02 = circleplane0.addByCenterRadius(sketchplane0.modelToSketchSpace(plane0.geometry.origin), 1.05)

 

you should achieve the desired result. This substitutes the centerpoint with the origin of the construction plane which is in fact on the spline.

Sample screenshot:

Screenshot 2023-11-04 173141.png

 

 

 

 

 

 

 

 

 

 

I Hope this helps!

Message 3 of 3

Thanks so much!

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