Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Get the diameter of a CylindricalFace selection

sandeepdutta
Contributor

Get the diameter of a CylindricalFace selection

sandeepdutta
Contributor
Contributor

Hello All,

 

I am selecting a CylindricalFace using

 

si = inputs.addSelectionInput('wheelDia', 'Select Wheel Outer face', 'Select wheel diameter surface')
si.setSelectionLimits(1,1)
si.addSelectionFilter('CylindricalFaces')
 
How do I obtain the "Diameter" of the selected  CylindricalFace.
 
Sandeep
0 Likes
Reply
315 Views
2 Replies
Replies (2)

BrianEkins
Mentor
Mentor

What you'll get back, in this case, is a BRepFace object. A BRepFace object represents any face in a model, regardless of its shape. But because you've set the filter to "CylindricalFaces" it will only allow the selection of BRepFaces object whose underlying geometry is a cylinder.

 

The BRepFace object supports the geometry property, which will return one of many types of objects depending on what type of geometry is associated with the BRepFace. In your case, it will always return a Cylinder object. The Cylinder object supports many methods and properties to get information about the cylinder, including the radius property which will return the radius in centimeters.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
2 Likes

sandeepdutta
Contributor
Contributor
That worked out. Thank you.
Sandeep
0 Likes