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.