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.

DrawingObjectEnumerator Class

The DrawingObjectEnumerator class provides the means to iterate through drawing object instances. Drawing object enumerators are generated by the container view and they contain drawing objects that are children of the container view instance.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Drawing
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
public sealed class DrawingObjectEnumerator : DrawingEnumeratorBase

The DrawingObjectEnumerator type exposes the following members.

Properties
  Name Description
Public property Current
Gets the current drawing object.
Top
Methods
  Name Description
Public method GetEnumerator
Allows the usage of the foreach statement with DrawingObjectEnumerator.
(Inherited from DrawingEnumeratorBase.)
Public method GetSize
Returns the total amout of items.
(Inherited from DrawingEnumeratorBase.)
Public method MoveNext
Moves to the next item in the enumerator.
(Inherited from DrawingEnumeratorBase.)
Public method Reset
Resets the enumerator to the beginning.
(Inherited from DrawingEnumeratorBase.)
Top
Fields
  Name Description
Public field SelectInstances
Indicates that the instance Select() is called when the 'Current' item is asked from the enumerator. The user can set this to 'false' if no members are ever asked from the instance. This is the case when, for example, asking only a report property from the identifier. Warning: normally the user should not change this value.
(Inherited from DrawingEnumeratorBase.)
Top
Examples
using Tekla.Structures.Drawing;

public class Example
{
       public void Example1()
       {
           DrawingHandler DrawingHandler = new DrawingHandler();
           Drawing CurrentDrawing = DrawingHandler.GetActiveDrawing();

           // Loop through all objects in the drawing and delete all existing line objects.
           DrawingObjectEnumerator AllObjects = CurrentDrawing.GetSheet().GetAllObjects();

           while(AllObjects.MoveNext())
           {
               if(AllObjects.Current is Line)
               {
                   AllObjects.Current.Delete();
               }
           }
       }
}
See Also