Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ynapeu
786 Views, 7 Replies

How can i get the Faces of a SurfaceBody

Hello 

i want the faces of a SurfaceBody.

 

but the Function CalculateFacets creates a crash.

I have checked the oBodybox the have Vertices and so on.

Is there some trick to get the Facets?

 

public SurfaceBody tempTest(Inventor.Application oApp)
{
TransientGeometry oTransGeom = oApp.TransientGeometry;
TransientBRep oTransientBRep = oApp.TransientBRep;

Box box1 = oApp.TransientGeometry.CreateBox();
box1.MinPoint = (oApp.TransientGeometry.CreatePoint(0, 0, 0));
box1.MaxPoint = (oApp.TransientGeometry.CreatePoint(30, 30, 40));
SurfaceBody oBodybox = oTransientBRep.CreateSolidBlock(box1);

int count1 = 0;
int facecount1 = 0;
double[] Vertex1 = { };
double[] Normalvect1 = { };
int[] vertexindeces1 = { };

try
{
oBodybox.CalculateFacets(0.001, out count1, out facecount1, out Vertex1, out Normalvect1, out vertexindeces1);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}

return (oBodybox);
}

Labels (1)