EdgeEnumerator Class

The EdgeEnumerator class is used to enumerate the edges of a solid.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.SolidEdgeEnumerator

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

The EdgeEnumerator type exposes the following members.

Properties
  NameDescription
Public propertyCurrent
Gets the current edge.
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
{
    public void Example1()
    {
        ModelObjectEnumerator myEnum = new Model().GetModelObjectSelector().GetAllObjectsWithType(new Type[] { typeof(Part) });
        while (myEnum.MoveNext())
        {
            try
            {
                Part part = myEnum.Current as Part;
                if (part != null)
                {
                    Console.WriteLine("Part id: " + part.Identifier.ID.ToString());
                    Solid solid = part.GetSolid();
                    if (solid != null)
                    {
                        EdgeEnumerator edgeEnumerator = solid.GetEdgeEnumerator();
                        int edgeCount = 0;
                        while (edgeEnumerator.MoveNext())
                        {
                            var edge = edgeEnumerator.Current as Edge;
                            if (edge != null)
                            {
                                Console.WriteLine("Start : " + edge.StartPoint.ToString());
                                Console.WriteLine("End : " + edge.EndPoint.ToString());
                                Console.WriteLine("Type : " + edge.Type.ToString());
                                edgeCount++;
                            }
                        }

                        Console.WriteLine("Edge count : " + edgeCount.ToString());
                    }
                }
            }
            catch { }
        }
    }
}
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