try this rule. but make sure you test it manual. if you can't do it manually then the rule will crash. while testing I could for example not use the XY plane because it was perpendicular to the cylinder
Dim doc As PartDocument = ThisDoc.Document
Dim def As PartComponentDefinition = doc.ComponentDefinition
Dim xyPlane As WorkPlane = def.WorkPlanes.Item("XY Plane")
Dim cilinder As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Select a cilinder")
' Input Point object that indicates which of the possible two solutions to use.
' For cylinders and spheres the plane can be on either side of the surface.
' Which solution to use will be determined by which side the proximity point is
' closest to. This point is only used for the initial computation. During a
' recompute the plane will remain on the same side of the tangent surface
' regardless of its position relative to the originally specified point.
Dim point As Point = ThisApplication.TransientGeometry.CreatePoint(0, 0, 0)
def.WorkPlanes.AddByPlaneAndTangent(xyPlane, cilinder, point)
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com