ShellEnumerator Class

The ShellEnumerator class is used to enumerate the shells of a solid.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.SolidShellEnumerator

Namespace:  Tekla.Structures.Solid
Assembly:  Tekla.Structures (in Tekla.Structures.dll) Version: 2023.0.3
Syntax
public sealed class ShellEnumerator : IEnumerator

The ShellEnumerator type exposes the following members.

Properties
  NameDescription
Public propertyCurrent
Gets the current shell.
Top
Methods
  NameDescription
Public methodMoveNext
Moves to the next item in the enumerator.
Public methodReset
Resets the enumerator to the beginning.
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Solid;
using Tekla.Structures.Geometry3d;

public class Example
{

    private static Beam CreateBeam(Point p1, Point p2, String profileName, bool SetAsOperativeClass)
    {
        Beam beam1 = new Beam
        {
            StartPoint = p1,
            EndPoint = p2,
            Profile = { ProfileString = profileName },
            Finish = "PAINT",
            Material = { MaterialString = "S235JR" },
            Position = { Depth = Position.DepthEnum.MIDDLE },
            Class = SetAsOperativeClass ? BooleanPart.BooleanOperativeClassName : "1"
        };

        return beam1;
    }

    public void Example1()
    {
        Beam beam1 = CreateBeam(new Point(1000.0, 1000.0, 0.0), new Point(1000.0, 2000.0, 0.0), "500*500", false);
        Beam beam2 = CreateBeam(new Point(500.0, 1500.0, 250.0), new Point(1500.0, 1500.0, 250.0), "500*500", true);
        BooleanPart cut = new BooleanPart { Father = beam1 };
        cut.SetOperativePart(beam2);

        Solid solid1 = beam1.GetSolid(Solid.SolidCreationTypeEnum.RAW);
        Solid solid2 = beam1.GetSolid(Solid.SolidCreationTypeEnum.NORMAL);

        ShellEnumerator shells = solid1.GetCutPart(solid2);

        int shellCount = 0;
        var faceCounts = new List<int>();

        while (shells.MoveNext())
        {
            var shell = shells.Current as Shell;
            if (shell != null)
            {
                FaceEnumerator faces = shell.GetFaceEnumerator();
                faceCounts.Insert(shellCount, 0); 
                while(faces.MoveNext())
                {
                    faceCounts[shellCount]++; 
                }
            }
            shellCount++;
        }
    }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next