Create a sketch/plane trough a cylinder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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