ShapeItemEnumerator Class

The ShapeItemEnumerator class allows to loop through the shape catalog items.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.CatalogsShapeItemEnumerator

Namespace:  Tekla.Structures.Catalogs
Assembly:  Tekla.Structures.Catalogs (in Tekla.Structures.Catalogs.dll) Version: 2023.0.3
Syntax
[SerializableAttribute]
public sealed class ShapeItemEnumerator : IEnumerator

The ShapeItemEnumerator type exposes the following members.

Properties
  NameDescription
Public propertyCurrent
Returns a shape item instance of the current element.
Top
Methods
  NameDescription
Public methodGetSize
Returns the total amount of items.
Public methodMoveNext
Moves to the next item in the enumerator.
Public methodReset
Resets the enumerator to the beginning.
Top
Examples
The following example returns true if an item with the name Connection has been found:
using Tekla.Structures.Catalogs;

public class Example
{
       public bool Example1()
       {
           bool Result = false;

           CatalogHandler CatalogHandler = new CatalogHandler();

           if (CatalogHandler.GetConnectionStatus())
           {
               ShapeItemEnumerator ShapeItemEnumerator = CatalogHandler.GetShapes();

               while (ShapeItemEnumerator.MoveNext())
               {
                   ShapeItem ShapeItem = ShapeItemEnumerator.Current as ShapeItem;

                   if (ShapeItem.Name == "Connection")
                   {
                       Result = true;
                       break;
                   }
               }
           }

           return Result;
       }
}
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