Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Create a sketch/plane trough a cylinder

jonasZUZ5J
Participant

Create a sketch/plane trough a cylinder

jonasZUZ5J
Participant
Participant

I'm trying to create a plane trough a cylinder to crate a sketch on the plane.

 

My current method gets the cylinder axis and creates a plane at the axis using setByAngle.

But I have to set the planeEntity to be perpendicular to the axis. I fist used a the XY construction plane, but this doesn't work for every axis/cylinder orientation.

 

When using the UI and crating a plane at an Angle I don't have to set a plane where th angle is measured from.
Is there a way to get a valid planeEntity plane or any other method to create a plane through a cylinder?

 

 

       # Create cylinder axis
        axes = activeComp.constructionAxes
        axisInput = axes.createInput()
        axisInput.setByCircularFace(cylinder)
        axis = axes.add(axisInput)
        axis.isLightBulbOn = False

        # Create sketch plane at cylinder axis
        xyPlane = activeComp.xYConstructionPlane
        planes = activeComp.constructionPlanes
        planeInput = planes.createInput()
        angle = adsk.core.ValueInput.createByString('0 deg')
        planeInput.setByAngle(axis, angle, xyPlane)
        plane = planes.add(planeInput)
        plane.isLightBulbOn = False

 

 

 

 

Unbenannt.PNG

 

0 Likes
Reply
822 Views
1 Reply
Reply (1)

goyals
Autodesk
Autodesk

May be you can use face of cylinder used to create axis and call geometry method, http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-7f577231-f85d-441e-888e-a62934fe99a1,  on it which will give you underlying plane and pass that as input to setByAngle method. 

 

faces = body.faces

face = faces[1]

plane  = face.geometry



Shyam Goyal
Sr. Software Dev. Manager
0 Likes