Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get the diameter of a CylindricalFace selection

2 REPLIES 2
Reply
Message 1 of 3
sandeepdutta
161 Views, 2 Replies

Get the diameter of a CylindricalFace selection

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
2 REPLIES 2
Message 2 of 3
BrianEkins
in reply to: sandeepdutta

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
in reply to: BrianEkins

That worked out. Thank you.
Sandeep

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report