We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2019-10-16 01:48 PM - last edited on 2022-09-29 10:06 AM by Daniel Kassai
2019-10-16 02:48 PM
GS::Array<API_Guid> wallGuids; ACAPI_Element_GetElemList (API_WallID, &wallGuids); for (UIndex ii = 0; ii < wallGuids.GetSize (); ++ii) { API_Element element = {}; element.header.guid = wallGuids[ii]; GSErrCode err = ACAPI_Element_Get (&element); if (err != NoError) continue; const API_WallType& wall = element.wall; wall.begC; // start coordinate of the wall reference line wall.endC; // end coordinate of the wall reference line API_ElementMemo memo = {}; err = ACAPI_Element_GetMemo (wall.head.guid, &memo); if (err != NoError) continue; if (memo.coords) { // (*memo.coords) array contains the outside coordinates for (Int32 i = 1; i <= wall.poly.nCoords; i++) { (*memo.coords).x; (*memo.coords).y; } } ACAPI_DisposeElemMemoHdls (&memo); }What do you mean by the center coordinate of the wall?
2019-10-17 05:49 AM
Tibor wrote:Thanks.
Hi,
Here's a short code snippet for getting the outside coordinates of walls:GS::Array<API_Guid> wallGuids; ACAPI_Element_GetElemList (API_WallID, &wallGuids); for (UIndex ii = 0; ii < wallGuids.GetSize (); ++ii) { API_Element element = {}; element.header.guid = wallGuids[ii]; GSErrCode err = ACAPI_Element_Get (&element); if (err != NoError) continue; const API_WallType& wall = element.wall; wall.begC; // start coordinate of the wall reference line wall.endC; // end coordinate of the wall reference line API_ElementMemo memo = {}; err = ACAPI_Element_GetMemo (wall.head.guid, &memo); if (err != NoError) continue; if (memo.coords) { // (*memo.coords) array contains the outside coordinates for (Int32 i = 1; i <= wall.poly.nCoords; i++) { (*memo.coords).x; (*memo.coords).y; } } ACAPI_DisposeElemMemoHdls (&memo); }What do you mean by the center coordinate of the wall?
Do you mean the center of the reference line of the wall? In that case you can simply calculate it from the wall.begC and wall.endC, since those are the start and the end coordinates of the wall reference line.