ACAPI_​Attribute_​IsClassificationItemVisible

Tells whether a classification item is visible for an attribute.

    bool  ACAPI_Attribute_IsClassificationItemVisible (        
        const API_Attr_Head&  attrHead,
        const API_Guid&       classificationGuid
    );

 

Parameters

attrHead
[in] Header of the attribute. The attribute is identified by typeID and index
classificationGuid
[in] The classification item GUID to search for.

 

Return Values

true
The given classification item is visible for the attribute. It can return true even if the parent of the classification item is hidden.
false
The given classification item is not visible for the attribute or invalid parameters.

Example

GSErrCode GetVisibleClassificationItems (API_AttrTypeID attributeTypeID, short attributeIndex, GS::Array<API_ClassificationItem>& visibleClassifications)
{
    API_Attr_Head                     attributeHeader;
    GS::Array<API_ClassificationItem> definitions;
	
    BNZeroMemory (&attributeHeader, sizeof (API_Attr_Head));
    attributeHeader.typeID = attributeTypeID;
    attributeHeader.index = attributeIndex;
	
    GSErrCode error = ACAPI_Classification_GetClassificationItems (APINULLGuid, definitions);
    if (error == NoError) {
        for (UInt32 i = 0; i < definitions.GetSize (); ++i) {
            if (ACAPI_Attribute_IsClassificationItemVisible (attributeHeader, definitions[i].guid)) {
                visibleClassifications.Push (definitions[i]);
            }
        }
    }
    return error;
}
        
For more detailed examples, please see the Classification_Test add-on.

 

Requirements

Version:API 23 or later
Header: ACAPinc.h

 

See Also

Classifications,
Classification and Property Visibility