Archicad 28 C++ API
|
Functions for creating, handling and deleting custom (Add-On specific) User Data attached to specific elements or element groups. More...
Functions | |
GSErrCode | ACAPI_UserData_GetUserData (API_Attr_Head *attrHead, API_AttributeUserData *userData) |
Obtains the user data attached to an attribute. | |
GSErrCode | ACAPI_UserData_SetUserData (API_Attr_Head *attrHead, const API_AttributeUserData *userData) |
Attaches user data to an attribute, or deletes the attached data. | |
GSErrCode | ACAPI_Element_GetUserData (API_Elem_Head *elemHead, API_ElementUserData *userData, UInt32 mask=0) |
Obtains the user data attached to an element or an element default. | |
GSErrCode | ACAPI_Element_SetUserData (API_Elem_Head *elemHead, const API_ElementUserData *userData) |
Attaches the user data to an element or an element default. | |
GSErrCode | ACAPI_UserData_DeleteUserData (API_Elem_Head *elemHead) |
Removes the user data attached to the specified element. | |
GSErrCode | ACAPI_Grouping_GetUserData (const API_Guid &groupGuid, API_UserData *userData) |
Obtains the user data attached to an element group. | |
GSErrCode | ACAPI_Grouping_SetUserData (const API_Guid &groupGuid, const API_UserData *userData) |
Attaches the user data to the element group. | |
Functions for creating, handling and deleting custom (Add-On specific) User Data attached to specific elements or element groups.
This paper give hints on:
any elements placed onto the floor plan.
All Archicad elements can hold extra information (the previous 128-byte limit has been removed in Archicad 8). The registration table is global for the whole project; add-ons are identified by their module ID. It means that one add-on can save the same number of bytes to any kind of element.
The structure of the user data is unified for Archicad 8, and it contains the following required fields:
The registration table is saved into the project file. Archicad never deletes any registration data. This ensures that your custom data will be preserved, even if your add-on is not installed. It can happen if the user moves a project onto another Archicad installation. If you pass a nullptr handle in the appropriate part of the user data, the custom data will be erased.
The registration itself does not ensure that the data structure of every database element will be extended automatically by the requested number of bytes. These extra bytes are allocated on your request only.
To add your extra bytes to a given element, you should call the ACAPI_Element_SetUserData function, and you can get your data assigned to any element with the ACAPI_Element_GetUserData function. On the parameter list you have to pass an API_ElementUserData structure to store the requested data.
GSErrCode ACAPI_Element_GetUserData | ( | API_Elem_Head * | elemHead, |
API_ElementUserData * | userData, | ||
UInt32 | mask = 0 |
||
) |
Obtains the user data attached to an element or an element default.
elemHead | [in] Identifies the element or element default (only fields type and guid are used). |
userData | [in/out] Pointer to the user data. |
mask | [in] Optional mask. Currently valid values are 0 and APIElemMask_FloorPlan . In the latter case, the elements in the floor plan database are counted directly, without changing the database first. |
GSErrCode ACAPI_Element_SetUserData | ( | API_Elem_Head * | elemHead, |
const API_ElementUserData * | userData | ||
) |
Attaches the user data to an element or an element default.
elemHead | [in] Header of the element (only fields type and guid are used). |
userData | [in] Pointer to the new user data. |
elemHead->type
is necessary and elemHead->guid
should be APINULLGuid
. To set data to an element only elemHead->guid is necessary and it should be set to element's guid. Use the ACAPI_Element_GetUserData function to get data from the element record. Note that this function is not undoable in case of element default setting. The caller should allocate and deallocate the userData->dataHdl handle. GSErrCode ACAPI_Grouping_GetUserData | ( | const API_Guid & | groupGuid, |
API_UserData * | userData | ||
) |
Obtains the user data attached to an element group.
groupGuid | [in] Unique ID of the element group. |
userData | [in/out] Pointer to the new user data. |
GSErrCode ACAPI_Grouping_SetUserData | ( | const API_Guid & | groupGuid, |
const API_UserData * | userData | ||
) |
Attaches the user data to the element group.
groupGuid | [in] Unique ID of the element group. |
userData | [in] Pointer to the new user data. |
GSErrCode ACAPI_UserData_DeleteUserData | ( | API_Elem_Head * | elemHead | ) |
Removes the user data attached to the specified element.
elemHead | [in] Identifies the element the user data is attached to. |
GSErrCode ACAPI_UserData_GetUserData | ( | API_Attr_Head * | attrHead, |
API_AttributeUserData * | userData | ||
) |
Obtains the user data attached to an attribute.
attrHead | [in] Header of the attribute (only fields typeID and index are used). |
userData | [in/out] Pointer to the user data. |
GSErrCode ACAPI_UserData_SetUserData | ( | API_Attr_Head * | attrHead, |
const API_AttributeUserData * | userData | ||
) |
Attaches user data to an attribute, or deletes the attached data.
attrHead | [in] The attribute to attach the user data to is defined by the typeID and index fields of the header. |
userData | [in] The user data to store. If dataHdl is nullptr, then the function deletes the user data. |