ACAPI_​Interface_​ClearElementHighlight

Removes element highlights from 2D (floor plan and section) and 3D window.

    GSErrCode ACAPI_Interface_ClearElementHighlight ();

 

Return Values

NoError
The function has completed with success.

For other common API errors see the API Errors document.

 

Remarks

This function removes element highlights set by ACAPI_Interface_SetElementHighlight.

After changing element highlights the model needs to be redrawn by calling ACAPI_Automate (APIDo_RedrawID).

 

Example


//------------------------------------------------------
// Highlight every mesh
//------------------------------------------------------
static void Do_HighlightElements (void)
{
    static bool hled = false;

    if (hled) {
        // remove the highlight
        ACAPI_Interface_ClearElementHighlight ();
        ACAPI_Automate (APIDo_RedrawID);
    } else {
        GS::Array<API_Guid> meshList;
        ACAPI_Element_GetElemList (API_MeshID, &meshList);

        if (meshList.GetSize () > 0) {
            GS::HashTable<API_Guid, API_RGBAColor>  hlElems;
            API_RGBAColor   hlColor = { 0.0, 0.5, 0.75, 0.5 };
            for (auto it = meshList.Enumerate (); it != nullptr; ++it) {
                hlElems.Add (*it, hlColor);
                hlColor.f_red += 0.1;
                if (hlColor.f_red > 1.0)
                    hlColor.f_red = 0.0;
            }

            bool wireframe3D = false;
            API_RGBAColor nonHighlightedElemsColor = {0.7, 0.7, 0.7, 0.95};

            ACAPI_Interface_SetElementHighlight (hlElems, wireframe3D, nonHighlightedElemsColor);
            ACAPI_Automate (APIDo_RedrawID);
        }
    }

    hled = !hled;
}

 

Requirements

Version: API 26 or later
Header: ACAPinc.h

 

See Also

ACAPI_Interface_SetElementHighlight,
API Functions