ACAPI_​ElemComponent_​GetPropertyValue

Retrieves the specified property definition’s value from the component.

    GSErrCode  ACAPI_ElemComponent_GetPropertyValue (
        const API_ElemComponentID&     elemComponent,
        const API_Guid&                propertyDefinitionGuid,
        API_Property&                  property
    );
    

 

Parameters

elemComponent
[in] The identifier of the element’s component to search for.
propertyDefinitionGuid
[in] The property definition to get the values for.
property
[out] The value of the requested property.

 

Return Values

NoError
The function has completed with success.
APIERR_BADID
The elemComponent did not refer to a valid component.
APIERR_GENERAL
The propertyDefinitionGuid did not refer to a valid property definition.

For other common API errors see the API Errors document.

 

Example


GSErrCode GetPropertyValue (const API_ElemComponentID& elemComponent, API_PropertyValue& value)
{
    GS::Array<API_PropertyDefinition> definitions;
    GSErrCode error = ACAPI_ElemComponent_GetPropertyDefinitions (elemComponent, API_PropertyDefinitionFilter_All, definitions);
    if (error == NoError && !definitions.IsEmpty ()) {
        API_Property property = {};
        error = ACAPI_ElemComponent_GetPropertyValue (elemComponent, definitions[0].guid, property);
        if (error == NoError) {
            value = property.value;
        }
    }

    return error;
}
        

Requirements

Version: API 25 or later
Header: ACAPinc.h

 

See Also

Properties,
API Functions