API Help
Eplan.EplApi.DataModel Namespace / PropertyValue Class / LastUsedIndex Property
Example

In This Topic
    LastUsedIndex Property (PropertyValue)
    In This Topic
    Returns number of highest used index. Indexes start from 1. If it wasn't a indexed-property or there is no used index, LastUsedIndex is 0; Object of PropertyValue had to point to property from project not to individual value.
    Syntax
    public int LastUsedIndex {get;}
    public:
    property int LastUsedIndex {
       int get();
    }
    Exceptions
    ExceptionDescription
    Thrown when property wasn't an indexed\-property.
    Remarks

    When there are unused indexes between used this property will return last one before first empty property index.

    For example:

    1st, 2nd and 10th indexes are used so LastUsedIndex will return 2nd index as last used.

    Example
    PropertyValue oProperty = m_oTestProject.Pages[0].Functions[0].Properties[ FUNC_INDEXED_PROPERTY ];
    if(oProperty.IsIndexed)
    {
      for ( int i = oProperty.LastUsedIndex ; i \>= 1 ; --i )
      {
          PropertyValue oPropertyElement = oProperty[ i ];
          string sProperty = oPropertyElement.ToString();
      }
    }
    See Also