Sets the specified property for the given values on an element.
GSErrCode ACAPI_Element_SetProperty ( const API_Guid& elemGuid, const API_Property& property );
Parameters
- elemGuid
- [in] The element GUID to search for.
- property
- [in] Specifies the property to be set.
Return Values
NoError
- The function has completed with success.
APIERR_BADID
- The
elemGuid
did not refer to a valid element. APIERR_NOACCESSRIGHT
- The current user does not have the right to modify the properties of the specified element on a teamwork server.
APIERR_READONLY
- Tried to modify a read-only property (for example a property coming from a hotlink).
APIERR_BADPROPERTY
- The property definition is not available for the given element.
For other common API errors see the API Errors document.
Example
For more detailed examples, please see the Property_Test add-on.GSErrCode SetFirstPropertyValueToDefault (const API_Guid& elemGuid) { GS::Array<API_PropertyDefinition> definitions; GSErrCode error = ACAPI_Element_GetPropertyDefinitions (elemGuid, API_PropertyDefinitionFilter_UserDefined, definitions); if (error == NoError && definitions.GetSize () > 0) { API_Property property = {}; error = ACAPI_Element_GetPropertyValue (elemGuid, definitions[0].guid, property); if (error == NoError) { property.isDefault = true; error = ACAPI_Element_SetProperty (elemGuid, property); } } return error; }
Requirements
- Version: API 20 or later
- Header: ACAPinc.h