Functions related to selection and marquee, including selecting elements and listing selected elements or elements included in the marquee.
More...
Functions related to selection and marquee, including selecting elements and listing selected elements or elements included in the marquee.
◆ APISelectionChangeHandlerProc
typedef GSErrCode APISelectionChangeHandlerProc(const API_Neig *selElemNeig) |
User supplied callback procedure for handling selection changes.
- Parameters
-
selElemNeig | [in] This structure identifies the last selected element. |
- Returns
- NoError - The function has completed with success.
◆ API_SelRelativePosID
Types of the relative position to marquee criteria.
Enumerator |
---|
API_InsidePartially | Inside partially.
|
API_InsideEntirely | Inside Entirely
|
API_OutsidePartially | Outside Partially
|
API_OutsideEntirely | Outside Entirely
|
◆ API_SelTypeID
Types of the selection.
Enumerator |
---|
API_SelEmpty | Nothing is selected
|
API_SelElems | Individual elements are selected
|
API_MarqueePoly | Selection is based on marquee poly
|
API_MarqueeHorBox | Selection is based on marquee horizontal box
|
API_MarqueeRotBox | Selection is based on marquee rotated box
|
◆ ACAPI_Notification_CatchSelectionChange()
Turns the monitoring of selection changes on/off.
- Parameters
-
handlerProc | [in] The callback procedure to call when notifications are sent out on changes in the selection. Specifying nullptr here means you don't need the notifications any more. |
- Returns
- NoError - The function completed successfully.
- Example
static GSErrCode SelectionChangeHandler (
const API_Neig *selElemNeig)
{
char msgStr[256];
if (selElemNeig->
neigID != APINeig_None) {
sprintf (msgStr, "Last selected element: NeigID %d; index: %d, inIndex: %d",
} else
return NoError;
}
{
}
◆ ACAPI_Selection_DeselectAll()
GSErrCode ACAPI_Selection_DeselectAll |
( |
| ) |
|
Adds/removes a number of elements to/from the current selection.
- Returns
- NoError - The function has completed with success.
- APIERR_BADDATABASE - The current database is not proper for the operation.
- Example
GSErrCode Do_SelectAllWalls (void)
{
GS::Array<API_Guid> wallGuids;
GS::Array<API_Neig> selNeigs;
for (
const API_Guid& guid : wallGuids) {
selNeigs.Push (neig);
}
}
◆ ACAPI_Selection_Get()
Returns information on the selection, and the selected elements.
- Parameters
-
selectionInfo | [out] The parameters of the current selection. The typeID field of the selectionInfo gives the selection type. |
selNeigs | [out] An array containing the GUIDs of the selected elements. Can be nullptr if you are interested in the selection information only. |
onlyEditable | [in] Tells whether you are interested in editable elements only. |
ignorePartialSelection | [in] Retrieves also partial element selection information or the element itself only selected as whole (for legacy compatibility reasons, the default value of this parameter is true, meaning partial selection is ignored). This parameter is ignored in case of marquee based selection. |
relativePosToMarquee | [in] Retrieves elements relative to marquee (for legacy compatibility reasons, the default value of this parameter is API_InsidePartially , meaning only those elements will be returned which have an intersection with the marquee area). This parameter is ignored in case of individually selected elements. |
- Returns
- NoError - The function has completed with success.
- APIERR_NOPLAN - There is no open project.
- APIERR_NOSEL - There is no selection. Note that this is not a real error!
- Example
GSErrCode SelectDimensions (GS::Array<API_Guid>& inds)
{
GS::Array<API_Neig> selNeigs;
return err;
}
}
for (
const API_Neig& selNeig : selNeigs) {
tElemHead.
type = Neig_To_ElemID (selNeig.neigID);
continue;
continue;
tElemHead.
guid = selNeig.guid;
continue;
inds.Push (tElemHead.
guid);
}
return NoError;
}
◆ ACAPI_Selection_GetSelectedElement()
GSErrCode ACAPI_Selection_GetSelectedElement |
( |
const API_Neig * | apiNeig, |
|
|
API_Guid * | apiGuid ) |
Converts an API_Neig structure to an API_Guid.
- Parameters
-
apiNeig | [in] The Neig describing a point of the Element. |
apiGuid | [out] The GUID of the Subelement at that point. |
- Returns
- NoError - The function has completed with success.
- APIERR_BADPARS - apiGuid or apiNeig is nullptr.
◆ ACAPI_Selection_Select()
GSErrCode ACAPI_Selection_Select |
( |
const GS::Array< API_Neig > & | selNeigs, |
|
|
bool | add ) |
Adds/removes a number of elements to/from the current selection.
- Parameters
-
selNeigs | [in] The elements to be added/removed (array of API_Neig objects); |
add | [in] If true, adds the elements to the current selection, otherwise removes them from the selection. |
- Returns
- NoError - The function has completed with success.
- APIERR_BADDATABASE - The current database is not proper for the operation.
- APIERR_BADID - The element unique ID is invalid. The element type is invalid, or the element type is not supported by the server application.
- APIERR_BADPARS - The passed parameter contains invalid data; selNeigs.
- Example
GSErrCode Do_SelectAllWalls (void)
{
GS::Array<API_Guid> wallGuids;
GS::Array<API_Neig> selNeigs;
for (
const API_Guid& guid : wallGuids) {
selNeigs.Push (neig);
}
}
◆ ACAPI_Selection_SetMarquee()
Changes the current marquee selection.
- Parameters
-
selectionInfo | [in] The parameters of the marquee to be set. |
- Returns
- NoError - The function has completed with success.
- APIERR_BADPARS - The selectionInfo parameter is nullptr
- APIERR_BADDATABASE - The active database is neither the floorplan, nor a section database
◆ ACAPI_Selection_SetSelectedElementNeig()
GSErrCode ACAPI_Selection_SetSelectedElementNeig |
( |
const API_Guid * | apiGuid, |
|
|
API_Neig * | apiNeig ) |
Converts an API_Guid structure to an API_Neig.
- Parameters
-
apiGuid | [in] The GUID of the Subelement at that point. |
apiNeig | [out] The Neig describing a point of the Element. |
- Returns
- NoError - The function has completed with success.
- APIERR_BADPARS - apiGuid or apiNeig is nullptr.