ACAPI_​Element_​GetPropertyObjects

Returns property objects of the element.

    GSErrCode  ACAPI_Element_GetPropertyObjects (
        const API_Elem_Head*             elemHead,
        API_PropertyObjectRefType***     propRefs,
        Int32*                           nProp
    );

 

Parameters

elemHead 17
[in] The element to get the properties for.
propRefs
[out] List of property objects.
nProp
[out] Number of the property objects.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
propRefs or nProp is nullptr
APIERR_BADID
Incorrect elemHead was specified
APIERR_MEMFULL
Not enough memory to get the properties

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the list of property objects for a linked element. The properties can be associated with construction elements by criteria or by individual direct assignment. This applies to all construction elements.

6.1  From Archicad 9 the linked properties of both an element instance and the element defaults can be accessed with two new functions: ACAPI_Element_GetLinkedPropertyObjects and ACAPI_Element_SetLinkedPropertyObjects.

 

Example


void GetProperties (const API_Guid& guid)
{
    API_Elem_Head              elemHead;
    API_PropertyObjectRefType  **propRefs;
    API_LibPart                libPart;
    Int32                      nProp, i;
    char                       s[256];
    GSErrCode                  err;

    BNZeroMemory (&elemHead, sizeof (API_Elem_Head));
    elemHead.guid = guid;

    err = ACAPI_Element_GetPropertyObjects (&elemHead, &propRefs, &nProp);
    if (err == NoError) {
        for (i = 0; i < nProp; i++) {
            BNZeroMemory (&libPart, sizeof (API_LibPart));
            libPart.index = (*propRefs)[i].libIndex;
            err = ACAPI_LibPart_Get (&libPart);
            if (err == NoError) {
                if ((*propRefs)[i].assign)
                    sprintf (s, "Associated property:");
                else
                    sprintf (s, "Property by criteria:");
                sprintf (s, "%s %s", s, (const char *) GS::UniString (libPart.docu_UName).ToCStr ());
                ACAPI_WriteReport (s, false);
            }
        }
        BMKillHandle ((GSHandle *) &propRefs);
    }
}

 

Requirements

Version: API 2.1 or later
Header: ACAPinc.h

 

See Also

API_ElemTypeID
API_PropertyObjectRefType
ACAPI_Element_GetLinkedPropertyObjects
ACAPI_Element_SetLinkedPropertyObjects
Element Manager
Listing Manager
API Functions