Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ndillner343SKL
150 Views, 1 Reply

Find Matching Surface

Hello,

I'm taking a system com object "Entity" from the assembly level. I'm then opening up the part document and within the part document. I'm trying to find the corresponding surface for "Entity". Currently I'm evaluating the surface areas. The issue is there are multiple surfaces with the same area. And its mixing them up. Is there a better way to find the matching surface for "Entity"?

 

"face.Evaluator.Area = Entity.Evaluator.Area"

 

Sub NameEntity(Entity As Face, Name As String)
Dim doc As PartDocument = ThisApplication.ActiveDocument

Dim FaceEval = doc.ComponentDefinition.SurfaceBodies.
    Cast(Of SurfaceBody).
    SelectMany(Of Face)(Function(f) f.Faces.Cast(Of Face)).
    Aggregate(Function(face, nextFace) If(face.Evaluator.Area = Entity.Evaluator.Area, face, nextFace))