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

In This Topic
    LastUsedIndex Property (PropertyValue)
    In This Topic
    Returns the number of the highest used index. Indexes start at 1. If the property is not indexed or there is no used index, LastUsedIndex is 0. To use the LastUsedIndex property, the PropertyValue object must point to a project property (persistent property).It cannot point to an individual value (transient property).
    Syntax
    public int LastUsedIndex {get;}
    public:
    property int LastUsedIndex {
       int get();
    }
    Exceptions
    ExceptionDescription
    Thrown when property is not indexed.
    Remarks

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

    For example:

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

    Example
    Function function = page.Functions[0]; // A valid Function object
    
    PropertyValue propertyValue = function.Properties.FUNC_CONNECTIONDESIGNATION;
    
    if (propertyValue.Definition.IsIndexed)
    {
        for (int i = propertyValue.LastUsedIndex ; i >= 1 ; --i)
        {
            PropertyValue propertyElement = propertyValue[i];
            string sProperty = propertyElement.ToString();
        }
    }
    
    
    
    See Also