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

In This Topic
    Id Property (MDPropertyValue)
    In This Topic
    Returns P8-Property descriptor ( id and index ) of the object. Off-line MDPropertyValue objects don't have descriptors because they point to value directly. off-line MDPropertyValue is created by operators that take base types values.
    Syntax
    public MDAnyPropertyId Id {get;}
    public:
    property MDAnyPropertyId^ Id {
       MDAnyPropertyId^ get();
    }
    Exceptions
    ExceptionDescription
    Thrown when object is off-line.
    Example
    MDPropertyValue pV = "123";	// Off-line object
    MDPropertyValue pV2= 12;	// Off-line object
    
    MDPropertyValue pV3 = same_parts_database.Part[0].Properties[ Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.SAME_PROPERTY /* property id */ ];
    //pV3.Id == Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.SAME_PROPERTY
    // In this case, where index wasn't specified, pV3.Id.Index is 0.
    
    MDPropertyValue pV4 = same_parts_database.Part[0].Properties[ Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.SAME_PROPERTY /* property id */ , 1  /* property index */ ];
    //pV4.Id == Eplan.EplApi.MasterData.Properties.MDPartsDatabaseItem.SAME_PROPERTY
    //pV4.Index == 1
    int propertyId	  = pV4.Id.Id;
    int propertyIndex = pV4.Id.Index;
    See Also