cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
poco2013
Mentor

Zone Areas

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 11 - Visual Studio 2022; ArchiCAD 27
1 Solution

Accepted Solutions
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;
}

Go to post

2 Replies 2
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
Mentor
Worked perfectly - Completely missed this.

Thanks
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!