Archicad 27 C++ API
Loading...
Searching...
No Matches
Cutaway and Cutting Planes

Functions related to the Cutting Planes (Cutaway) management. More...

Functions

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_Is3DCutawayEnabled (bool *param)
 Returns whether the 3DCutaway is enabled.
 
GSErrCode __ACENV_CALL ACAPI_CuttingPlane_Set3DCutawayStatus (bool *param)
 Turns the 3DCutaway on/off.
 
GSErrCode __ACENV_CALL ACAPI_CuttingPlane_IsCuttingPlanesVisible (bool *param)
 Returns whether the Cutting Planes are visible.
 
GSErrCode __ACENV_CALL ACAPI_CuttingPlane_SetCuttingPlanesVisibility (bool *param)
 Shows or hides the Cutting Planes.
 
GSErrCode __ACENV_CALL ACAPI_CuttingPlane_GetCutPolygonInfo (Int32 bodyIndex, const API_Plane3D &cutPlane, GS::Array< Geometry::MultiPolygon2D > *resPolygons=nullptr, double *area=nullptr)
 Cuts a body with a plane and returns the cutting surface and area.
 

Detailed Description

Functions related to the Cutting Planes (Cutaway) management.

Function Documentation

◆ ACAPI_CuttingPlane_GetCutPolygonInfo()

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_GetCutPolygonInfo ( Int32  bodyIndex,
const API_Plane3D cutPlane,
GS::Array< Geometry::MultiPolygon2D > *  resPolygons = nullptr,
double *  area = nullptr 
)

Cuts a body with a plane and returns the cutting surface and area.

Parameters
bodyIndex[in] The index of the body to cut.
cutPlane[in] Cutting plane.
resPolygons[out] Polygons of the cutting surface. (optional parameter)
area[out] Area of the cutting surface. (optional parameter)
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The passed output parameter are both nullptr (resPolygons and area)
  • APIERR_REFUSEDCMD - The 3D model is not available in the current context, or The body cannot be queried directly; not active body
  • APIERR_BADINDEX - The bodyIndex is out of range
Remarks
This function is used to cut a given body with a cutting plane and get the cutting surface. To get the polygons of the cutting surface, pass the resPolygons parameter. To get only the area of the cutting surface, set the area parameter. One of the output parameters (resPolygons and area) must be not nullptr.
Example
Int32 nBody, i, j;
API_Plane3D cutPlane;
double area;
GS::Array<Geometry::MultiPolygon2D> resPolygons;
cutPlane.basePoint.x = 0.0; cutPlane.basePoint.y = 0.0; cutPlane.basePoint.z = 1.0;
cutPlane.axisX.x = 1.0; cutPlane.axisX.y = 0.0; cutPlane.axisX.z = 0.0;
cutPlane.axisY.x = 0.0; cutPlane.axisY.y = 1.0; cutPlane.axisY.z = 0.0;
cutPlane.axisZ.x = 0.0; cutPlane.axisZ.y = 0.0; cutPlane.axisZ.z = 1.0;
err = ACAPI_ModelAccess_GetNum (API_BodyID, &nBody);
for (i = 1; i <= nBody && err == NoError; i++) {
err = ACAPI_CuttingPlane_GetCutPolygonInfo (i, cutPlane, &resPolygons, &area);
if (err == NoError) {
for (j = 0; j <= resPolygons.GetSize (); j++) {
double areaOfThisPolygon = resPolygons[j].CalcArea ();
}
}
}
GSErrCode __ACENV_CALL ACAPI_CuttingPlane_GetCutPolygonInfo(Int32 bodyIndex, const API_Plane3D &cutPlane, GS::Array< Geometry::MultiPolygon2D > *resPolygons=nullptr, double *area=nullptr)
Cuts a body with a plane and returns the cutting surface and area.
GSErrCode __ACENV_CALL ACAPI_ModelAccess_GetNum(API_3DTypeID typeID, Int32 *count)
Returns the number of existing 3D components.
double x
The x factor.
Definition: APIdefs_Base.h:104
double z
The z factor.
Definition: APIdefs_Base.h:114
double y
The y factor.
Definition: APIdefs_Base.h:109
Desribes a 3D plane.
Definition: APIdefs_Base.h:680
API_Vector3D axisZ
The Z axis.
Definition: APIdefs_Base.h:700
API_Vector3D axisX
The X axis.
Definition: APIdefs_Base.h:690
API_Vector3D axisY
The Y axis.
Definition: APIdefs_Base.h:695
API_Coord3D basePoint
Base point of the plane.
Definition: APIdefs_Base.h:685

◆ ACAPI_CuttingPlane_Is3DCutawayEnabled()

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_Is3DCutawayEnabled ( bool *  param)

Returns whether the 3DCutaway is enabled.

Parameters
param[out] returns the current state.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_CuttingPlane_IsCuttingPlanesVisible()

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_IsCuttingPlanesVisible ( bool *  param)

Returns whether the Cutting Planes are visible.

Parameters
param[out] returns the current state.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_CuttingPlane_Set3DCutawayStatus()

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_Set3DCutawayStatus ( bool *  param)

Turns the 3DCutaway on/off.

Parameters
param[in] sets the current state.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_CuttingPlane_SetCuttingPlanesVisibility()

GSErrCode __ACENV_CALL ACAPI_CuttingPlane_SetCuttingPlanesVisibility ( bool *  param)

Shows or hides the Cutting Planes.

Parameters
param[in] sets the current state.
Returns
  • NoError - The function has completed with success.