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.

ComponentItemEnumerator Class

The ComponentItemEnumerator class allows to loop through the component catalog items.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.CatalogsComponentItemEnumerator

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

The ComponentItemEnumerator type exposes the following members.

Properties
  Name Description
Public property Current
Returns a component item instance of the current element.
Top
Methods
  Name Description
Public method GetSize
Returns the total amout of items.
Public method MoveNext
Moves to the next item in the enumerator.
Public method Reset
Resets the enumerator to the beginning.
Top
Examples
The following example returns true if an item with the name EndPlate and with the number 144 has been found:
using Tekla.Structures.Catalogs;

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

           CatalogHandler CatalogHandler = new CatalogHandler();

           if (CatalogHandler.GetConnectionStatus())
           {
               ComponentItemEnumerator ComponentItemEnumerator = CatalogHandler.GetComponentItems();

               while (ComponentItemEnumerator.MoveNext())
               {
                   ComponentItem ComponentItem = ComponentItemEnumerator.Current as ComponentItem;

                   if (ComponentItem.Name == "EndPlate" && ComponentItem.Number == 144)
                   {
                       Result = true;
                       break;
                   }
               }
           }

           return Result;
       }
}
See Also