ACAPI_​Attribute_​DeleteMore

Deletes more attributes of the same type.

    GSErrCode  ACAPI_Attribute_DeleteMore (
        const API_Attr_Head*     attrHead,
        API_AttributeIndex*      attrIndexListPtr
    );

 

Parameters

attrHead
[in] The typeID fields in the header identifies the type of the attributes to delete.
attrIndexListPtr
[in] List of attribute indices to be deleted.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The passed parameter (attrHead) is nullptr
APIERR_REFUSEDPAR
You tried to delete pens, fonts, a solid or an empty fill, or an attribute with index 1.
APIERR_NOTMINE
The attribute is out of the users workspace.

For other common API errors see the API Errors document.

 

Remarks

This function is the extension of ACAPI_Attribute_Delete. You can specify a list of attribute indices to be deleted. If you pass nullptr in the attrIndexListPtr parameter, this function works like ACAPI_Attribute_Delete.

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

 

Example


API_Attribute attrib;
BNZeroMemory (&attrib, sizeof (API_Attribute));
attrib.header.typeID = API_LinetypeID;

API_AttributeIndex* attrIndexListPtr = (API_AttributeIndex*) BMAllocatePtr (3 * sizeof (API_AttributeIndex), ALLOCATE_CLEAR, 0);
if (attrIndexListPtr != nullptr) {
    attrIndexListPtr[0] = 3;
    attrIndexListPtr[1] = 4;
    attrIndexListPtr[2] = 5;

    GSErrCode err = ACAPI_Attribute_DeleteMore (&attrib.header, attrIndexListPtr);
    if (err != NoError) {
        // failed to delete the attributes
    }

    BMKillPtr ((GSPtr *) &attrIndexListPtr);
}

 

Requirements

Version: API 11 or later
Header: ACAPinc.h

 

See Also

API_Attr_Head, API_AttributeIndex
ACAPI_Attribute_Delete
Attribute Manager
API Functions