License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

Zone Polygon with different Construction method

Anonymous
Not applicable
Hi,
For now I am trying to fetch Zone's outline with API,first all I placed a Rectangular Wall with Center Construction method.And placed a Zone in the area with Inner Edge Construction method.(figure 1)

I use some code with snippet:
//------------------------Code--------------------------
//elem with ZoneTypeID

ACAPI_Element_GetMemo(elem.header.guid,&elemMemo);

for (int j = 1; j <= elem.zone.poly.nSubPolys; j++)
{
begInd = (*elemMemo.pends) [j-1] + 1;
endInd = (*elemMemo.pends) ;

for (int x = begInd; x < endInd; x++,wallIdx++)
{
begC = (*elemMemo.coords) ;
endC = (*elemMemo.coords) [x+1];

arcInd = FindArc (*elemMemo.parcs, elem.zone.poly.nArcs, x);
if(arcInd != -1)
{
Walls[wallIdx].type = WALLTYPE_ARC;
ArcGetOrigo(&begC,&endC,(*elemMemo.parcs)[arcInd].arcAngle,&arcC);
Walls[wallIdx].arcCenterX = arcC.x;
Walls[wallIdx].arcCenterY = arcC.y;

diameter = DistCPtr(&begC,&arcC) * 2;

Walls[wallIdx].len = (diameter * PI * ((*elemMemo.parcs)[arcInd].arcAngle * RADDEG) / 360);
}
else
{
Walls[wallIdx].type = WALLTYPE_LINEAR;
Walls[wallIdx].len = DistCPtr(&begC,&endC);
}

Walls[wallIdx].pt1X = begC.x;
Walls[wallIdx].pt1Y = begC.y;
Walls[wallIdx].pt2X = endC.x;
Walls[wallIdx].pt2Y = endC.y;

Log("Extract Wall begC: endC: Length:[%f]",
Walls[wallIdx].pt1X,Walls[wallIdx].pt1Y,Walls[wallIdx].pt2X,Walls[wallIdx].pt2Y,
Walls[wallIdx].len);
}
}

ACAPI_DisposeElemMemoHdls(&elemMemo);
//------------------------Code End---------------------

I fetched all the four Wall with following Values:

[14:54:01.976]:Extract Wall begC: endC: Length:[3.880000]
[14:54:01.976]:Extract Wall begC: endC: Length:[3.880000]
[14:54:01.976]:Extract Wall begC: endC: Length:[3.880000]
[14:54:01.976]:Extract Wall begC: endC: Length:[3.880000]

Of course The Area of Zone is 3.88 * 3.88 = 15.54 square meter,Just the same as the figure showed.


The problem is,When I change the constriction method with Zone to "Reference Line" with Gross Polygon(figure 2) with 16 square meter

I expecting With the same code, I'll get the "expanded Polygon with Zone",But I got the same result with that...

[15:02:34.235]:Extract Wall begC: endC: Length:[3.880000]
[15:02:34.235]:Extract Wall begC: endC: Length:[3.880000]
[15:02:34.235]:Extract Wall begC: endC: Length:[3.880000]
[15:02:34.235]:Extract Wall begC: endC: Length:[3.880000]

How can I fetch the "right" Zone outline just like Reference Line Method showed?

Thanks.

2.png
1 REPLY 1
Anonymous
Not applicable
alright, I resolved this problem,Just replace one line

ACAPI_Database(APIDb_GetAdditionalPolyID,&elem.zone.refPoly_id,&elemMemo,NULL);
//ACAPI_Element_GetMemo(elem.header.guid,&elemMemo);



thanks.