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

Zone Areas

poco2013
Advisor
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?
Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 26
1 ACCEPTED SOLUTION
2 REPLIES 2

Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
You can retrieve the calculated quantities of an element using ACAPI_Element_GetQuantities function.
This function returns the area of the given zone:
double 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;
}

poco2013
Advisor
Worked perfectly - Completely missed this.

Thanks
Gerry

Windows 10 - Visual Studio 2019; ArchiCAD 26

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!