SOLVED!
Element Quantities is zero
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-10-31
09:16 AM
- last edited on
2022-10-05
01:33 PM
by
Daniel Kassai
2018-10-31
09:16 AM
Tried the following on AC22:
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.
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 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ARCHICAD 27 INT (since AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-01 04:41 AM
2018-11-01
04:41 AM
Hi ,Maybe you are not using ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
I am working normally in AC22.
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);
1 REPLY 1
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2018-11-01 04:41 AM
2018-11-01
04:41 AM
Hi ,Maybe you are not using ACAPI_ELEMENT_COMPOSITES_QUANTITY_MASK_SETFULL(mask);
I am working normally in AC22.
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);