ACAPI_​Attribute_​Search

Searches for an attribute by name.

    GSErrCode  ACAPI_Attribute_Search (
        API_Attr_Head*     attrHead
    );

 

Parameters

attrHead
[in/out] The attribute to search for, identified by the typeID and name or the guid fields of the header.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The passed parameter is nullptr; attrHead
APIERR_BADID
The attribute type is invalid
APIERR_BADNAME
The attribute with the given name doesn’t exist

For other common API errors see the API Errors document.

 

Remarks

This function is used to search for an attribute by name or by GUID API 11.
Upon return, the index and other applicable fields of the header are set.

The primary search criteria is the GUID, then the Unicode name (if present), then the name field of the header.

This function cannot be used to search for pens; they don’t have any name or GUID.

 

Example


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

/* find out the index of the "Wave" line type */
attrib.header.guid = GSGuid2APIGuid (GS::Guid ("35DE8210-A51E-43AE-9837-8CF3A01E8F63"));

GSErrCode err = ACAPI_Attribute_Search (&attrib.header);
if (err == NoError) {
    char msgStr[512];
    sprintf (msgStr, "[%d] %s", attrib.header.index, attrib.header.name);
    ACAPI_WriteReport (msgStr, true);
}

 

Requirements

Version: API 1.3 or later
Header: ACAPinc.h

 

See Also

API_Attr_Head,
Attribute Manager, API Functions