Tekla Open API

Detailed and full API reference helps you master Tekla Open API

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

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: 2018.1.0.0 (2018.1.0.0)
Syntax
public sealed class EdgeEnumerator : IEnumerator

The EdgeEnumerator type exposes the following members.

Properties
  Name Description
Public property Current
Gets the current edge.
Top
Methods
  Name Description
Public method MoveNext
Moves to the next item in the enumerator.
Public method Reset
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