Link property objects to an element or the element default.
GSErrCode ACAPI_Element_SetLinkedPropertyObjects ( API_Elem_Head* head, bool criteria, Int32 inviduallyLibInd );
Parameters
- head
- [in] Header of the element (only fields
type
andguid
are used). The setting is applied to element defaults ifguid
isAPINULLGuid
. - criteria
- [in] Determines whether the matching properties by criteria need to be linked to the element
- inviduallyLibInd
- [in] Library index of individually selected property to be linked to the element (value zero means no individual property is to be assigned)
Return Values
NoError
- The function has completed with success.
APIERR_BADPARS
head
isnullptr
APIERR_BADID
- Incorrect
type
was specified, or an element with the specifiedguid
was not found. APIERR_MEMFULL
- Not enough memory to set the properties
Remarks
This function is used to link property objects to an element. Properties can be associated with construction elements by criteria and/or by individual direct assignment (at most one individual assignment can be applied to an element). This applies to all types of construction elements. If no element is specified (ie. guid
is APINULLGuid
), the setting is applied to the defaults of the given element type.
Example
API_Element element; bool byCrit; Int32 indivLibInd; BNZeroMemory (&element, sizeof (API_Element)); element.header.type = API_ColumnID; ACAPI_Element_GetDefaults (&element, nullptr); element.column.origoPos.x = x; element.column.origoPos.y = y; ... ACAPI_CallUndoableCommand ("Create column with properties linked", [&] () -> GSErrCode { GSErrCode err = ACAPI_Element_Create (&element, nullptr); if (err == NoError) { API_Elem_Head defHead; BNZeroMemory (&defHead, sizeof (API_Elem_Head)); defHead.type = API_ColumnID; // guid remains APINULLGuid err = ACAPI_Element_GetLinkedPropertyObjects (&defHead, &byCrit, &indivLibInd, nullptr, nullptr); // retrieve defaults if (err == NoError) err = ACAPI_Element_SetLinkedPropertyObjects (&element.header, true, 0); // link properties } return err; });
Requirements
- Version: API 6.1 or later
- Header: ACAPinc.h
See Also
API_Elem_Head
ACAPI_Element_GetLinkedPropertyObjects
ACAPI_Element_GetPropertyObjects
Element Manager
API Functions