Retrieves property objects linked to an element or the element default.
GSErrCode ACAPI_Element_GetLinkedPropertyObjects ( const API_Elem_Head* head, bool* criteria, Int32* inviduallyLibInd, Int32** critLibInds, Int32* nCrits );
Parameters
- head
- [in] Header of the element (only field
guid
is used). Properties linked to the default element are retrieved whenguid
isAPINULLGuid
- criteria
- [out] Determines whether the matching properties by criteria are linked to the element
- inviduallyLibInd
- [out] Library index of individually assigned property (value zero means no individual property assigned)
- critLibInds
- [out] Aray of the library indices of linked properties matching the criteria
- nCrits
- [out] Number of linked properties matching the criteria
Return Value
NoError
- The function has completed with success.
APIERR_BADPARS
head
isnullptr
APIERR_BADID
- Incorrect
head
was specified APIERR_MEMFULL
- Not enough memory to get the properties
Remarks
This function is used to get the list of property objects for a linked 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 default settings of the given element type are retrieved.
Any of the arguments except head
can be nullptr
, in this case the function retrieves only the rest of the parameters.
Remember to free the critLibInds
array when not needed any more.
Example
void GetLinkedProperties (const API_Guid& guid) { API_Element element; BNClear (element); element.header.guid = guid; err = ACAPI_Element_Get (&element); if (err == NoError) { bool byCrit; Int32 indivLibInd; Int32 nCrits; Int32 *critLibInds; if (ACAPI_Element_GetLinkedPropertyObjects (&element.header, &byCrit, &indivLibInd, &critLibInds, &nCrits) == NoError) { if (indivLibInd != 0) { DBPrintf ("Library index of individually linked property is %d.\n", indivLibInd); } if (byCrit) { DBPrintf ("Library indices of linked properties matching criteria are [ "); for (Int32 i = 0; i < nCrits; ++i) { DBPrintf ("%d ", critLibInds[i]); } DBPrintf ("].\n"); } BMKillPtr ((GSPtr *) &critLibInds); // dispose critLibInds } } }
See also the example of the ACAPI_Element_SetLinkedPropertyObjects function.
Requirements
- Version: API 6.1 or later
- Header: ACAPinc.h
See Also
API_Elem_Head
ACAPI_Element_SetLinkedPropertyObjects
ACAPI_Element_GetPropertyObjects
Element Manager
API Functions