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

In This Topic
    Item Property (PropertyValue)
    In This Topic
    Returns or sets the object of a persistent PropertyValue which points to a specific index. To use the Item property, the PropertyValue object must point to a project property (persistent property).It cannot point to an individual value (transient property).
    Syntax
    public PropertyValue this[ 
       int index
    ]; {get; set;}
    public:
    property PropertyValue^ default [int] {
       PropertyValue^ get(int index);
       void set (int index, PropertyValue^ value);
    }

    Parameters

    index
    Exceptions
    ExceptionDescription
    InvalidIndexException
    NotIndexedPropertyException
    IndexedPropertyException
    Is thrown when set is used on a transient property.
    Remarks
    If an invalid index is used, an exception of type InvalidIndexException is thrown. If no index is specified for an indexed property, an exception of type IndexedPropertyException will be thrown.
    Example
    Function function = page.Functions[0]; // A valid Function object
    
    PropertyValue propertyValue = function.Properties.FUNC_CONNECTIONDESIGNATION;
    
    if(propertyValue.Definition.IsIndexed && propertyValue.Definition.MaxIndex >= 2)
    {
        // We will let the variable propertyElement point to an indexed property, so an index is needed to get the logical value.
        PropertyValue propertyElement = propertyValue[1]; // Now propertyElement points to the first index of the FUNC_CONNECTIONDESIGNATION property
        string sProperty = propertyElement.ToString();
    }
    
    
    
    See Also