ACAPI_​Attribute_​GetDefExt

Retrieves extended information for an attribute.

    GSErrCode  ACAPI_Attribute_GetDefExt (
        API_AttrTypeID           typeID,
        API_AttributeIndex       index,
        API_AttributeDefExt*     defs
    );

 

Parameters

typeID
[in] Type of the attribute.
index
[in] Index of the attribute.
defs
[out] The extended information for an attribute.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The passed parameter (defs) is nullptr
APIERR_BADID
The attribute type is invalid; see Remarks
APIERR_BADINDEX
The attribute index is invalid
APIERR_DELETED
The attribute doesn’t exist in the database.

For other common API errors see the API Errors document.

 

Remarks

This function is used to return detailed information on the specified attribute.

This function is available only for lines, fills, composites, layers, and zone categories. Other type of attributes do not have extended information; all of the their data can be passed through the API_Attribute structure. See the ACAPI_Attribute_Get function to get the base parameters of an attribute.

Do not forget to dispose the returned data handles if they are not needed any more. Use the ACAPI_DisposeAttrDefsHdlsExt function for this purpose.

Use this function instead of ACAPI_Attribute_GetDef function because API_AttributeDefExt structure contains more fields – detailed information for composite wall attribute – than API_AttributeDef.

 

Example


API_Attribute          attrib;
API_AttributeDefsExt   defs;
GSErrCode              err;

/* retrieve all information for the "Comp Wall 0.6" composite */

BNZeroMemory (&attrib, sizeof (API_Attribute));
BNZeroMemory (&defs, sizeof (API_AttributeDefsExt));

attrib.header.typeID = API_CompWallID;
CHCopyC ("Comp Wall 0.6", attrib.header.name);
err = ACAPI_Attribute_Get (&attrib);
if (err == NoError)
    err = ACAPI_Attribute_GetDefExt (attrib.header.typeID, attrib.header.index, &defs);
ACAPI_DisposeAttrDefsHdlsExt (&defs);

 

Requirements

Version: API 5.1 or later
Header: ACAPinc.h

 

See Also

API_AttrTypeID, API_Attribute, API_AttributeDefExt, API_AttributeIndex,
ACAPI_Attribute_Get, ACAPI_DisposeAttrDefsHdlsExt,
Attribute Manager, API Functions