Action based on color of part face

Action based on color of part face

Anonymous
Not applicable
519 Views
2 Replies
Message 1 of 3

Action based on color of part face

Anonymous
Not applicable

I am using Inventor 2016.

 

I am trying to perform an action based on the color of a part's face.  The code below checks each face - the If statement (obviously not real) needs to check the color of the current face but I cannot figure out how to write the statement.  Can someone help?

 

 

Dim oDoc as PartDocument = ThisDoc.Document
Dim oDef as PartComponentDefinition = oDoc.COmponentDefinition

Dim area As Double = 0.0

For Each oSurfBody As SurfaceBody In oDef.SurfaceBodies
    
	For Each oFace As Face In oSurfBody.faces
		If color Of face = "Canary" Then ' How to write this line to check face color?			Dim oEval As SurfaceEvaluator = oFace.Evaluator
			area = area + oEval.Area
		End If
	Next

Next

' Do something with area value
0 Likes
Accepted solutions (1)
520 Views
2 Replies
Replies (2)
Message 2 of 3

rikard.nilsson
Collaborator
Collaborator
Accepted solution

Hi,

 

To get the name.. Use 

oFace.Appearance.DisplayName

 

Regards

Rikard

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you.  That was what I needed.

 

0 Likes