Executes tool commands on elements.
GSErrCode ACAPI_Element_Tool (
const GS::Array<API_Guid>& elemGuids,
API_ToolCmdID typeID,
void* pars
);
Parameters
- elemGuids
- [in] Array containing the GUIDs of the elements to work on.
- typeID
- [in] Type of the tool command. The possible values are listed below.
- pars
- Reserved for further use.
Return Values
NoError- The function has completed with success.
APIERR_BADDATABASE- The current database is not proper for the operation
APIERR_BADPARS- The passed parameter is incorrect;
typeID APIERR_MEMFULL- not enough memory to complete the operation
For other common API errors see the API Errors document.
Remarks
This function is used to execute tool commands on a set of elements. The elements are specified in the elemGuids array or if this parameter is an empty array, the function operates on the current selection. The functionality of each tool is equivalent to the corresponding commands of the Tools menu.
The following tool commands are available:
Meaning
APITool_GroupCreates a new group with the passed elements.
APITool_UngroupUngroups the passed elements.
APITool_SuspendGroupsSwitches the Suspend Groups mode On/Off.
APITool_LockLocks the passed elements.
APITool_UnlockUnlocks the passed elements.
APITool_BringToFrontBrings the passed elements above all the other.
APITool_BringForwardMoves forward the passed elements.
APITool_SendBackwardMoves backward the passed elements.
APITool_SendToBackSends behind the elements to be overlapped by all the other.
APITool_ResetOrderResets the default drawing order of the passed elements.
Example
// group all the walls together GS::Array<API_Guid> elemList; ACAPI_Element_GetElemList (API_WallID, &elemList); if (!elemList.IsEmpty ()) { ACAPI_Element_Tool (&elemList, APITool_Group, nullptr); }
Requirements
- Version: API 2.1 or later
- Header: ACAPinc.h