cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:
BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!

# How to get zone's points in ArchiCAD API?

Booster

Hello everyone,

I'm trying to create Fills based on zone points.

Everything is okay with the code below when I get the zone points and create Fill according to those points:

``````list<Point>* points = GetPointsInElement(eleZone, eleZone.zone.poly);

//-----------------------------------------------------------------

list<Point>* GetPointsInElement(API_Element element, API_Polygon poly)
{
API_ElementMemo memo{};

if (err != NoError) throw;

list<Point>* points = new list<Point>();

if (memo.coords) {

for (Int32 i = 1; i <= poly.nCoords; i++) {
API_Coord point = (*memo.coords)[i];
points->push_back(Point(point.x, point.y, 0));
}
}
ACAPI_DisposeElemMemoHdls(&memo);
delete points;
return (NULL);
}
//-------------------------``````

But when the zone's calculated area is different from zone's Measured Area (like the image below), then the shapes of Fill and Zone are no longer the same.

The border of the Zone is a red line between the walls (like the image below), but when creating a Fill based on the points of the zone, the border of the Fill is a blue line and lies inside the walls.

Do you know where I'm wrong? And can you help me solve this problem?
Thank you very much.

4 REPLIES 4
Graphisoft

Hi,

Best, Akos

I tried it, But the result isn't right. all coordinates equal zero.

Contributor

@Akos Somorjai  I also got the same error. Can you help me ?

Graphisoft

Hi,

Please take a look at the Do_DumpZone() function in Element_Snippets.cpp (Element_Test example). The ACAPI_Database(APIDb_RoomReductionsID, …) code shows that at the end of that function.

Best, Akos

Learn and get certified!