The Surface entity in Eyeshot contains a list of trim loops as a collection of curves properly oriented (counter-clockwise for outer ones, clockwise for inner loops).
To check if the surface is trimmed you can query the mySurf.IsTrimmed property. To loop over loops or loop curves use the mySurf.Trimming.ContourList property as you can see in the code snippet below.
The following code snippet demonstrates how to extract surface edge curves from the entity ent and to add them to the Design master entity collection with red color.
Surface surf = (Surface) ent;
ICurve[] curves = surf.ExtractEdges();
Entity[] entArray = new Entity[curves.Length];
for (int i = 0; i < curves.Length; i++)
entArray[i] = (Entity) curves[i];
design1.Entities.AddRange(entArray, Color.Red);
Comments
Hi Giulia
the edges do not change the color
ElseIf entType = "Surface" Then
ent.Color = Color.BlueViolet
Dim surf As Surface = CType(ent, Surface)
Debug.WriteLine("Surface Is Trimmed >> " & surf.IsTrimmed)
Dim curves As ICurve() = surf.ExtractEdges()
Dim entArray As Entity() = New Entity(curves.Length - 1) {}
For i As Integer = 0 To curves.Length - 1
entArray(i) = CType(curves(i), Entity)
Debug.WriteLine(entArray(i))
Next
Cncmodel.Entities.AddRange(entArray, Color.Red)
Debug.WriteLine(entArray.Length)
Debug
the surface is trimmed and it finds the curve
4
The thread 0x3f7c has exited with code 0 (0x0).
Surface Is Trimmed >> True
Curve - Primitive: GCurve 5, 22
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 3, 8
Curve - Primitive: GCurve 3, 6
Curve - Primitive: GCurve 3, 4
Curve - Primitive: GCurve 5, 13
Curve - Primitive: GCurve 3, 4
Curve - Primitive: GCurve 5, 6
Curve - Primitive: GCurve 5, 26
13
on the blue violet should be the red edge
Please sign in to leave a comment.