The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

User avatar
By poco2013
#286129
Is there any way to obtain the measured and calculated areas of Zones using the API. I can obtain the zone structure of 'API_Zone_Type' for each zone but it does not appear to contain a area parameter.

Need to compare zone areas to obtain FAR's and other factors and would prefer to do it within a "Add-on'. if someone could point me in the right direction?
User avatar
By Tibor Lorántfy
#286130
You can retrieve the calculated quantities of an element using ACAPI_Element_GetQuantities function.
This function returns the area of the given zone:
Code: Select alldouble GetAreaOfZone (const API_Guid& zoneGuid) { API_ElementQuantity quantity = {}; API_Quantities quantities = {}; API_QuantitiesMask mask; ACAPI_ELEMENT_QUANTITY_MASK_CLEAR (mask); ACAPI_ELEMENT_QUANTITY_MASK_SET (mask, zone, area); quantities.elements = &quantity; ACAPI_Element_GetQuantities (zoneGuid, nullptr, &quantities, &mask); return quantity.zone.area; }
User avatar
By poco2013
#286142
Worked perfectly - Completely missed this.

Thanks