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 sketch/plane trough a cylinder

1 REPLY 1
Reply
Message 1 of 2
jonasZUZ5J
754 Views, 1 Reply

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

Create a sketch/plane trough a cylinder

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

 

1 REPLY 1
Message 2 of 2
goyals
in reply to: jonasZUZ5J

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

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

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

Post to forums  

Autodesk Design & Make Report