ACAPI_​Attribute_​ModifyExt

Modifies an attribute.

    GSErrCode  ACAPI_Attribute_ModifyExt (
        API_Attribute*           attribute,
        API_AttributeDefExt*     defs
    );

 

Parameters

attribute
[in] The attribute to be modified is defined by the typeID and index fields of the header.
defs
[in] The extended information for the attribute where needed.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The passed parameter is nullptr; attribute, [defs]
APIERR_BADID
The attribute type is invalid
APIERR_BADINDEX
The attribute index is invalid
APIERR_DELETED
The attribute doesn’t exist in the database.
APIERR_REFUSEDPAR
For layers, fills and line types you cannot modify the attribute with index 1. Solid and empty fills are also unalterable.

For other common API errors see the API Errors document.

 

Remarks

This function is used to modify an attribute. The attribute to be modified is identified by the typeID and the index fields in the attribute header.

You can either modify the parameters passed through the API_Attribute structure or the extended information given in API_AttributeDefExt.

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

This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.

 

Example


API_Attribute           attrib;
API_AttributeDefsExt    defs;
short                   ltypeIndex;
GSErrCode               err;

BNClear (attrib);
BNClear (defs);

/* retrieve all information for the "Comp Wall 0.6" composite */
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);
}

if (err == NoError) {
    for (short i = 0; i < attrib.compWall.nComps + 1; i++) {
        (*defs.cwall_compLItems)[i].ltypeInd = 3;
        (*defs.cwall_compLItems)[i].linePen  = 3;
    }
    err = ACAPI_Attribute_ModifyExt (&attrib, &defs);
}

ACAPI_DisposeAttrDefsHdlsExt (&defs);

 

Requirements

Version: API 5.1 or later
Header: ACAPinc.h

 

See Also

API_Attribute, API_AttributeDefExt,
Attribute Manager, API Functions