ACAPI_​Element_​GetMoreQuantities

Returns information on the quantities parameters of multiple elements of the same type.

    GSErrCode  ACAPI_Element_GetMoreQuantities (
        const GS::Array<API_Guid>*     elemGuids,
        const API_QuantityPar*         params,
        GS::Array<API_Quantities>*     quantities,
        const API_QuantitiesMask*     mask
    );

 

Parameters

elemGuids
[in] Guids of the elements.
params
[in] Input parameters.
quantities
[Out] Optional quantity parameters, one in the array for each Guid.
The member pointers of the API_Quantities need to be filled with the same pattern.
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
Either elemGuids or quantities is nullptr, quantities does not have the same size as elemGuids, or mask is nullptr and either elements or composites field is nullptr in quantities.
APIERR_BADID
Incorrect elemGuids was specified.

For other common API errors see the API Errors document.

 

Remarks

This function is used to get the quantity parameters of multiple elements of the same type. The quantitites are: surface, volume, perimeter, length and several other parameters. This applies to all construction elements. The elemGuids and the quantities arrays need to have the same size.

Example


API_ElementQuantity       quantity;
GS::Array<API_Quantities> quantities;
API_QuantitiesMask        mask;
GS::Array<API_Guid>       elemGuids;
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.SetSize (1);
quantities[0].elements = &quantity;
elemGuids.Push (elemGuid);
params.minOpeningSize = EPS;
err = ACAPI_Element_GetMoreQuantities (&elemGuids, &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