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: 2023.0.3
Syntax
[SerializableAttribute]
public sealed class MaterialMarketSizesItemEnumerator : IEnumerator

The MaterialMarketSizesItemEnumerator type exposes the following members.

Properties
  NameDescription
Public propertyCurrent
Returns a MaterialMarketSizesItem instance with the current index.
Top
Methods
  NameDescription
Public methodMoveNext
Moves to the next item in the MaterialMarketSizesItemEnumerator.
Public methodReset
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
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next