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
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
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
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
Can't find what you're looking for? Ask the community or share your knowledge.