ACAPI_​Element_​GetSurfaceQuantities

Returns information of the given elements surfaces.

    GSErrCode  ACAPI_Element_GetSurfaceQuantities (
        const GS::Array<API_Guid>*                  elemGuids,
        const GS::Array<API_Guid>*                  coverElemGuids,
        GS::Array<API_ElemPartSurfaceQuantity>*     quantities
    );

 

Parameters

elemGuids
[in] Array of elem guids, to calculate surface informations.
coverElemGuids
[in] Array of elem guids to consider as cover elems, when calculating visible surfaces areas.
quantities
[out] Calculated surface information will be pushed into this array, in the same order as in elemGuids.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
Either elemGuids or coverElemGuids or quantities is nullptr

For other common API errors see the API Errors document.

 

Remarks

This function is used to get one or more elements surface informations, mainly surface area. When calculating the surface area you can specify which elements are considered as cover elems. The area where a cover elem overlaps the given element will be reduced from the whole surface of the elem.

Example


char		s[256] = { '\0' };
GS::Array<API_Guid>	elemGuids = GetWallGuids ();
GS::Array<API_Guid>	coverElemGuids = GetSlabGuids ();
GS::Array<API_ElemPartSurfaceQuantity>	elemPartSurfaces;

GSErrCode err = ACAPI_Element_GetSurfaceQuantities (&elemGuids, &coverElemGuids, &elemPartSurfaces);
if (err == NoError) {
  for (UInt32 i = 0; i < elemPartSurfaces.GetSize (); i++) {
    sprintf (s, "Visible area of %s without the parts covered by slabs is %.2lf", APIGuidToString (elemGuids[i]).ToCStr ().Get (), elemPartSurfaces[i].exposedSurface);
    ACAPI_WriteReport (s, true);
  }
}
		

 

Requirements

Version: API 20 or later
Header: ACAPinc.h

 

See Also

API Functions