ACAPI_​Element_​GetQuantities

Returns information on the quantities parameters of an element.

    GSErrCode  ACAPI_Element_GetQuantities (
        API_Guid                   elemGuid,
        const API_QuantityPar*     params,
        API_Quantities*            quantities,
        const API_QuantitiesMask*  mask
    );

 

Parameters

elemGuid
[in] Guid of the element.
params
[in] Input parameters.
quantities
[Out] Optional quantity parameters.
mask
[In] Optional parameter for masking the relevant fields of quantities (by default it is nullptr).
If the mask parameter is nullptr, then both elements and composites fields need to be filled in quantities.
For improving performance you can select which data is needed with the mask parameter. This feature provides filtered access to the required data; instead of converting all of them, the function returns only those which are in interest.

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
quantities is nullptr, or mask is nullptr and either elements or composites field is nullptr in quantities.
APIERR_BADID
Incorrect elemGuid was specified.

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the quantity parameters of an element. The quantitites are: surface, volume, perimeter, length and several other parameters. This applies to all construction elements.

Example


API_ElementQuantity quantity;
API_Quantities      quantities;
API_QuantitiesMask  mask;
API_QuantityPar   params;
char              s[256] = { '\0' };
GSErrCode         err;

ACAPI_ELEMENT_QUANTITY_MASK_CLEAR (mask);
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, surface1);
ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, wall, volume);

quantities.elements = &quantity;
params.minOpeningSize = EPS;
err = ACAPI_Element_GetQuantities (elemGuid, &params, &quantities, &mask);
if (!err) {
    sprintf (s, "surface1: %.2lf  volume: %.2lf", quantity.wall.surface1, quantity.wall.volume);
    ACAPI_WriteReport (s, true);
}

 

Requirements

Version: API 19.0 or later
Header: ACAPinc.h

 

See Also

API_ElemTypeID, API_QuantityPar, API_Quantities, API_QuantitiesMask, API_CWallComponent,
Element Manager, API Functions,
API_ElementQuantity, API_ElementQuantityMask, API_CompositeQuantity, API_CompositeQuantityMask, API_ElemPartQuantity, API_ElemPartCompositeQuantity,
API_BeamQuantity, API_WallQuantity, API_ColumnQuantity, API_WindowQuantity, API_DoorQuantity, API_SkylightQuantity, API_ObjectQuantity, API_LightQuantity, API_SlabQuantity, API_RoofQuantity, API_MeshQuantity, API_ZoneAllQuantity, API_HatchQuantity, API_CurtainWallQuantity, API_CWFrameQuantity, API_CWPanelQuantity, API_CWJunctionQuantity, API_CWAccessoryQuantity, API_ShellQuantity, API_MorphQuantity