Archicad 28 C++ API
Loading...
Searching...
No Matches
API_Attr_Head Struct Reference

Contains common information related to all attribute types. More...

#include <APIdefs_Attributes.h>

Public Attributes

API_AttrTypeID typeID
 Type of the attribute; this identifies the attribute along with the index field. Refer to the API_AttrTypeID structure to see the possible attribute types.
 
API_AttributeIndex index
 The attribute index is the current database index of the given attribute. References to any attribute are done through these indices. It goes from 1 to the maximum available attribute index for each attribute type. For pens the maximum value is always 255.
 
short flags
 The attribute flags. Attribute type specific values are described in the individual attribute sections (where applicable). The following values are common for all types of attributes:
 
char name [API_AttrNameLen]
 The name of the attribute as UTF-8 encoded C string, which appears in the appropriate dialogs.
 
API_Guid guid
 The globally unique identifier (GUID) of the attribute; can be used for identifying attributes with ACAPI_Attribute_Get and ACAPI_Attribute_Search.
 
UInt64 modiTime
 The last time the attribute was modified as GSTime .
 
GS::UniString * uniStringNamePtr
 Optional parameter for accessing the name of the attribute in UniString (UTF-16 encoded) format.
 

Detailed Description

Contains common information related to all attribute types.

Remarks
This structure contains general information about an attribute. Not all the fields are applicable to all attributes; see the description of the individual attributes. As a general rule, before calling any of the Attribute Manager functions, clear the whole structure, fill the necessary fields, then call the function. Clearing all fields in the structure is important for future compatibility; in the next API releases the fillers may have meanings. Note that the generalPtr pointer has been removed from the API_Attr_Head structure. You can access long attribute names in C string format (name) or in GS::UniString format (uniStringNamePtr). For deleting more attributes with one attribute function call use ACAPI_Attribute_DeleteMore. From Archicad 11 attribute names are stored in GS::UniString format. You can use UniString format for attribute operations to avoid loss of information due to character conversion. To achieve this set the pointer of a GS::UniString variable in the uniStringNamePtr field of the API_Attr_Head structure. Otherwise always set this field to nullptr. You can identify attributes by their GUID or name. If you want to refer to an attribute by name, set the guid member to APINULLGuid. Note that Fonts, Pens and Model View Options do not have own GUID, in their case the guid field always contains APINULLGuid. If you set uniStringNamePtr to point to a valid GS::UniString object, the content of the name character buffer is ignored.

Member Data Documentation

◆ flags

API_Attr_Head::flags

The attribute flags. Attribute type specific values are described in the individual attribute sections (where applicable). The following values are common for all types of attributes:

Value Description
APIAttr_IsClientCreated In teamwork mode, indicates whether an attribute was created by the client and not sent with the changes yet. Such an attribute can still be modified or deleted in teamwork mode (output only)