Makes a property definition available for all of given elements (it is created if it does not exist).

    GSErrCode  ACAPI_ElementList_AddProperty (
        API_PropertyDefinition&        definition,
        const GS::Array<API_Guid>&     elemGuids



[in] The GUID of the definition (if already existing) or the data of the definition to create.
[out] The GUID of the definition (if newly created) and the modified availability array.
[in] The array of elements, that the property should be available for.


Return Values

The function has completed with success.
The groupGuid of the parameter did not refer to a valid property group or one of the availabilities’ guid did not refer to a valid structural type category value or one of elemGuids did not refer to a valid element.
Do not have the right to create or modify a property definition on a teamwork server.
The name of the definition is already used in the given property group.
The value of the definition is inconsistent, for example the default value has a different value type than the definition itself.
One of enumerations did not have their value out of the allowed ones. This includes c++ enums (i.e. they were uninitialized or memsetted), and enumeration property values (the possibleEnumValues doesn’t contain the default value)

For other common API errors see the API Errors document.



GSErrCode CreateExamplePropertyDefinitionForSelection (API_Guid groupGuid, const GS::Array<API_Guid>& selectedElements, API_PropertyDefinition& definition)
    definition.guid = APINULLGuid;
    definition.groupGuid = groupGuid; = "Property Definition";
    definition.description = "An example property definition.";
    definition.collectionType = API_PropertySingleCollectionType;
    definition.valueType = API_PropertyBooleanValueType;
    definition.defaultValue.singleVariant.variant.type = definition.valueType;
    definition.defaultValue.singleVariant.variant.boolValue = false;

    return ACAPI_ElementList_AddProperty (definition, selectedElements);

For more detailed examples, please see the Property_Test add-on.



Version: API 20 or later
Header: ACAPinc.h


See Also

API Functions