Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Element Quantities is zero

ReignBough
Booster
Tried the following on AC22:

API_ElementQuantity eq;
GS::Array<API_CompositeQuantity> qcq;
API_Quantities q;
API_QuantityPar qp;
API_QuantitiesMask qm;
ACAPI_ELEMENT_QUANTITY_MASK_CLEAR(qm);
ACAPI_ELEMENT_QUANTITY_MASK_SETFULL(qm);
qp.minOpeningSize = 0.00;
q.elements = &eq;
q.composites = &qcq;
err = ACAPI_Element_GetQuantities(elem.header.guid, &qp, &q, &qm);
int cqCnt = qcq.GetSize();

It is inside a loop, where each element is being check, in this case, if it is wall or column. Then, will try to get the quantities of building material and/or surface of the element (depends on the input of the user).

There are no error (err = NoError) but the cqCnt is always zero on any model structure type (basic, composite, or profile)

EDIT: Also for AC21. AC20 is okay.
~ReignBough~
ARCHICAD 24 INT 4018 FULL (from AC18)
Windows 10 Pro, Intel Core i7-4790 CPU @ 3.60GHz, 32.0GB RAM, 64-bit OS
1 ACCEPTED SOLUTION

Solution
leilei
Enthusiast
Hi ,Maybe you are not using ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
I am working normally in AC22.
	
        GSErrCode			err = NoError;
	API_ElementQuantity	quantity;
	API_QuantitiesMask	mask;
	API_Quantities		quantities;
	API_QuantityPar		par;
	GS::Array<API_CompositeQuantity>         composites;
	quantities.composites = &composites;
	quantities.elements = &quantity;
	par.minOpeningSize = 0.3;
	ACAPI_ELEMENT_QUANTITY_MASK_SET(mask, column, coreVolume);
	ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
	err = ACAPI_Element_GetQuantities(guid, &par, &quantities, &mask);
	ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR(mask);
	ACAPI_ELEMENT_QUANTITY_MASK_CLEAR(mask);

View solution in original post

1 REPLY 1

Solution
leilei
Enthusiast
Hi ,Maybe you are not using ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
I am working normally in AC22.
	
        GSErrCode			err = NoError;
	API_ElementQuantity	quantity;
	API_QuantitiesMask	mask;
	API_Quantities		quantities;
	API_QuantityPar		par;
	GS::Array<API_CompositeQuantity>         composites;
	quantities.composites = &composites;
	quantities.elements = &quantity;
	par.minOpeningSize = 0.3;
	ACAPI_ELEMENT_QUANTITY_MASK_SET(mask, column, coreVolume);
	ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
	err = ACAPI_Element_GetQuantities(guid, &par, &quantities, &mask);
	ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_CLEAR(mask);
	ACAPI_ELEMENT_QUANTITY_MASK_CLEAR(mask);

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!