Message 1 of 3

Not applicable
04-12-2016
09:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.