ACAPI_​Attribute_​Modify

Modifies an attribute.

    GSErrCode  ACAPI_Attribute_Modify (
        API_Attribute*        attribute,
        API_AttributeDef*     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_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_AttributeDefs      defs;
short                  ltypeIndex;
GSErrCode              err;

BNClear (attrib);
BNClear (defs);

/* retrieve all information for the "Wave" line type */
attrib.header.typeID = API_LinetypeID;
CHCopyC ("Wave", attrib.header.name);
err = ACAPI_Attribute_Get (&attrib);
if (err == NoError) {
    err = ACAPI_Attribute_GetDef (attrib.header.typeID, attrib.header.index, &defs);
}

if (err == NoError) {
    attrib.header.flags |= APILine_ScaleWithPlan;
    attrib.lineType.defineScale = 100.0;
    err = ACAPI_Attribute_Modify (&attrib, &defs);
}

ACAPI_DisposeAttrDefsHdls (&defs);

 

Requirements

Version: API 1.3 or later
Header: ACAPinc.h

 

See Also

API_Attribute, API_AttributeDef,
Attribute Manager, API Functions