iLogic: Determine radius of a cylindrical face

iLogic: Determine radius of a cylindrical face

DRoam
Mentor Mentor
928 Views
2 Replies
Message 1 of 3

iLogic: Determine radius of a cylindrical face

DRoam
Mentor
Mentor

Say I have a cylindrical face selected. How would I use iLogic to determine its radius?

 

I've been experimenting with this code:

 

ThisDoc.Document.SelectSet.Item(1).Evaluator.GetCurvatures()

But I can't figure out how the inputs work.

 

My end goal is to have my rule select all cylindrical faces under a certain radius. Right now I'm just trying to figure out how to determine a given face's radius in the first place.

Accepted solutions (1)
929 Views
2 Replies
Replies (2)
Message 2 of 3

JaneFan
Autodesk
Autodesk
Accepted solution

Hi @DRoam

 

Radius of Cylindrical Face can be get in this way if you have select a cylindrical face in graphics window: 

SyntaxEditor Code Snippet

MsgBox(ThisDoc.Document.SelectSet(1).Geometry.Radius)

If you want to select any face with a certain value, take part as example: 

SyntaxEditor Code Snippet

Dim oDoc As PartDocument 
oDoc = ThisDoc.Document 
oDoc.SelectSet.Clear 

Dim oFace As Face
For Each oFace In oDoc.ComponentDefinition.SurfaceBodies(1).Faces
	If oFace.SurfaceType = SurfaceTypeEnum.kCylinderSurface Then 
		If oFace.Geometry.Radius = CertainRadiusValue Then 
			oDoc.SelectSet.Select(oFace)
		End If 
	End If 
Next 

 




Jane Fan
Inventor/Fusion QA Engineer
Message 3 of 3

DRoam
Mentor
Mentor

Perfect, just what I needed. Thank you!

0 Likes