ACAPI_​Element_​GetPropertyValueOfDefaultElem

Retrieves the value of the specified property definition.

    GSErrCode  ACAPI_Element_GetPropertyValueOfDefaultElem (
        const API_ElemType&          type,
        const API_Guid&         propertyDefinitionGuid,
        API_Property&           property
    );

 

Parameters

type
[in] Type of the default element.
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 type was specified.

For other common API errors see the API Errors document.

 

Remarks

New in API 26 From version 26 the typeID and variationID parameters were merged into a single API_ElemType parameter.

 

Example


GSErrCode GetPropertyValue (const API_ElemType& type, API_PropertyValue& value)
{
    GS::Array<API_PropertyDefinition> definitions;
    GSErrCode error = ACAPI_Element_GetPropertyDefinitionsOfDefaultElem (type, API_PropertyDefinitionFilter_UserDefined, definitions);
    if (error == NoError && definitions.GetSize () > 0) {
        API_Property property = {};
        error = ACAPI_Element_GetPropertyValueOfDefaultElem (type, 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