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.

ProfileItemEnumerator Class

The ProfileItemEnumerator class allows to loop through the catalog profile items.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.CatalogsProfileItemEnumerator

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 ProfileItemEnumerator : IEnumerator

The ProfileItemEnumerator type exposes the following members.

Properties
  Name Description
Public property Current
Returns a profile item instance of the current element.
Public property 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 for the available profile names or when only certain profiles need to be selected from the model. Without the selection the 'Current' item contains the profile name or the prefix and the profile type. Warning: normally the user should not change this value.
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 a library profile item with the name HEA300 has been found:
using Tekla.Structures.Catalogs;

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

        CatalogHandler CatalogHandler = new CatalogHandler();

        if (CatalogHandler.GetConnectionStatus())
        {
            ProfileItemEnumerator ProfileItemEnumerator = CatalogHandler.GetLibraryProfileItems();

            while (ProfileItemEnumerator.MoveNext())
            {
                LibraryProfileItem LibraryProfileItem = ProfileItemEnumerator.Current as LibraryProfileItem;

                if (LibraryProfileItem.ProfileName == "HEA300")
                {
                    Result = true;
                    break;
                }
            }
        }

        return Result;
    }
}
See Also