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

In This Topic
    Item Property (PropertyValue)
    In This Topic
    Returns or set object of PropertyValue which points to specific index.
    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 off-line property.
    Example
    PropertyValue oProperty = m_oTestProject.Pages[0].Functions[0].Properties[ FUNC_INDEXED_PROPERTY ];
    if(oProperty.IsIndexed && oProperty.MaxIndex > 2)
    {
    // oP_2 points to indexed property, so there is needed index to fetch logic value.
    PropertyValue oP_2 = oProperty[ 1 ]; // now oP_2 points to first index of property FUNC_INDEXED_PROPERTY
    string xxx = oP_2.ToString();
    if ( oProperty.MaxIndex < 100 )
    {
    	string xxxx = oProperty[ 100 ];	 // there will be thrown an exception : InvalidIndexException.
    	string xxxx2 = oProperty[ 0 ]; // there also.
    }
    	
    string xxx2 = oProperty; // there will be thrown an exception : IndexedPropertyException, because there wasn't set index.
    }
    See Also