ACAPI_​Element_​GetPropertyValueOfDefaultElem

Retrieves the value of the specified property definition.

    GSErrCode  ACAPI_Element_GetPropertyValueOfDefaultElem (
        API_ElemTypeID          typeID,
        API_ElemVariationID     variationID,
        const API_Guid&         propertyDefinitionGuid,
        API_Property&           property
    );

 

Parameters

typeID
[in] Type of the default element.
variationID
[in] The element variation that distinguishes the element kinds of the same type.
propertyDefinitionGuid
[in] The property definition’s GUID to get the value for.
properties
[out] The value of the requested property.

 

Return Values

NoError
The function has completed with success.
APIERR_BADID
Incorrect typeID or variationID was specified.

For other common API errors see the API Errors document.

 

Example


GSErrCode GetPropertyValue (API_ElemTypeID typeId, API_ElemVariationID variationID, API_PropertyValue& value)
{
    GS::Array<API_PropertyDefinition> definitions;
    GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (typeId, variationID, API_PropertyDefinitionFilter_UserDefined, definitions);
    if (error == NoError && definitions.GetSize () > 0) {
        API_Property property = {};
        error = ACAPI_Element_GetPropertyValueOfDefaultElem (typeId, variationID, definitions[0].guid, property);
        if (error == NoError) {
            value = property;
        }
    }

    return error;
}
        
For more detailed examples, please see the Property_Test add-on.

 

Requirements

Version: API 22 or later
Header: ACAPinc.h

 

See Also

Properties,
API Functions