Highlight elements in the 2D and 3D window.
GSErrCode ACAPI_Interface ( APIIo_HighlightElementsID, const GS::HashTable<API_Guid,API_RGBAColor>* elems const bool* wireframe3D );
Parameters
- elems
- Hash table containing the elements (identified by their GUIDs) and the colors to highlight the element with.
- [wireframe3D]
- Switch other elements in the 3D window to wireframe (does not have effect in case of using Vectorial Engine). Optional, can be nullptr.
Return Values
APIERR_REFUSEDCMD
- The internal list of elements to highlight is not empty. Did you forget to clear the list?
NoError
- The function has completed with success.
For other common API errors see the API Errors document.
Remarks
You should remove the highlight before you want to add other elements.
The function internally calls redraw.
Example
//------------------------------------------------------ // Highlight every mesh //------------------------------------------------------ static void Do_HighlightElements (void) { static bool hled = false; if (hled) { // remove the highlight ACAPI_Interface (APIIo_HighlightElementsID); } 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 = true; ACAPI_Interface (APIIo_HighlightElementsID, &hlElems, &wireframe3D); } } hled = !hled; }
Requirements
- Version: API 19 or later
- Header: APIdefs_Interface.h