Get the diameter of a CylindricalFace selection

Get the diameter of a CylindricalFace selection

sandeepdutta
Contributor Contributor
355 Views
2 Replies
Message 1 of 3

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
356 Views
2 Replies
Replies (2)
Message 2 of 3

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
Message 3 of 3

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