API Reference

Detailed and full API reference helps you master Tekla development

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

MaterialMarketSizesItemEnumerator Class

The MaterialMarketSizesItemEnumerator class allows to loop through the items defined in XS_PROFDB\marketsizes.dat file.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.CatalogsMaterialMarketSizesItemEnumerator

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

The MaterialMarketSizesItemEnumerator type exposes the following members.

Properties
  Name Description
Public property Current
Returns a MaterialMarketSizesItem instance with the current index.
Top
Methods
  Name Description
Public method MoveNext
Moves to the next item in the MaterialMarketSizesItemEnumerator.
Public method Reset
Resets the MaterialMarketSizesItemEnumerator to the beginning.
Top
Examples
The following example returns true if an item with the name S235JR has been found and there is at least one market size for the item:
using Tekla.Structures.Catalogs;

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

           CatalogHandler catalogHandler = new CatalogHandler();

           if (catalogHandler.GetConnectionStatus())
           {
               try
               {
                    MaterialMarketSizesItemEnumerator marketSizesEnumerator = catalogHandler.GetMaterialMarketSizes();

                    while (marketSizesEnumerator.MoveNext())
                    {
                        MaterialMarketSizesItem materialSpecificMarketSizes = marketSizesEnumerator.Current as MaterialMarketSizesItem;

                        if (materialSpecificMarketSizes != null)
                        {
                           if (materialSpecificMarketSizes.MaterialName == "S235JR")
                           {
                               if (materialSpecificMarketSizes.MarketSizes != null)
                               {
                                   if (materialSpecificMarketSizes.MarketSizes.Length > 0)
                                   {
                                        result = true;
                                        break;
                                   }
                               }
                           }
                        }
                    }
               }
               catch(CatalogItemEnumeratorInitializationException e)
               {
                    // Handle the exception here and see the inner exception for more details.     
               }
           }

           return result;
       }
}
See Also