API Help
Eplan.EplApi.MasterData Namespace / MDPropertyValue Class / Item Property
Example

In This Topic
    Item Property (MDPropertyValue)
    In This Topic
    Returns MDPropertyValue object at specified index.
    Syntax
    public MDPropertyValue this[ 
       int index
    ]; {get; set;}
    public:
    property MDPropertyValue^ default [int] {
       MDPropertyValue^ get(int index);
       void set (int index, MDPropertyValue^ value);
    }

    Parameters

    index
    Exceptions
    ExceptionDescription
    MDInvalidIndexException
    MDNotIndexedPropertyException
    MDIndexedPropertyException
    Thrown when setter is used on off-line property.
    Example
    MDPropertyValue oProperty = m_MDPartsDatabase.Parts[0].Properties[Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.ARTICLE_HEIGHT];
    if (oProperty.Definition.IsIndexed && oProperty.Definition.MaxIndex > 2)
    {                    
    	MDPropertyValue oPv = oProperty[1]; // now oPv points to first index of property FUNC_INDEXED_PROPERTY
    	string str = oPv.ToString();
    	if (oProperty.Definition.MaxIndex < 100)
    	{
    		string str1 = oProperty[100]; // throws MDInvalidIndexException exception
    		string str2 = oProperty[0]; // also throws MDInvalidIndexException exception
    	}
    	string str3 = oProperty; // throws MDInvalidIndexException exception, because valid index was not specified
    }
    See Also