<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I get the coordinates of  a wall？ in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264178#M3149</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here's a short code snippet for getting the outside coordinates of walls:
&lt;PRE&gt;GS::Array&amp;lt;API_Guid&amp;gt; wallGuids;
ACAPI_Element_GetElemList (API_WallID, &amp;amp;wallGuids);
for (UIndex ii = 0; ii &amp;lt; wallGuids.GetSize (); ++ii) {
	API_Element element = {};
	element.header.guid = wallGuids[ii];
	GSErrCode err = ACAPI_Element_Get (&amp;amp;element);
	if (err != NoError)
		continue;

	const API_WallType&amp;amp; 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, &amp;amp;memo);
	if (err != NoError)
		continue;

	if (memo.coords) {
		// (*memo.coords) array contains the outside coordinates
		for (Int32 i = 1; i &amp;lt;= wall.poly.nCoords; i++) {
			(*memo.coords)&lt;I&gt;.x;
			(*memo.coords)&lt;I&gt;.y;
		}
	}

	ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

What do you mean by the center coordinate of the wall?&lt;BR /&gt;
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.</description>
    <pubDate>Wed, 16 Oct 2019 12:48:56 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2019-10-16T12:48:56Z</dc:date>
    <item>
      <title>How can I get the coordinates of  a wall？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264177#M3148</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi,&lt;BR /&gt;How can I get the center and the outside coordinates of the wall?&lt;BR /&gt;In API，I can only the center or the outside coordinates？How can I get both?&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Sep 2022 08:06:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264177#M3148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-29T08:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of  a wall？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264178#M3149</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here's a short code snippet for getting the outside coordinates of walls:
&lt;PRE&gt;GS::Array&amp;lt;API_Guid&amp;gt; wallGuids;
ACAPI_Element_GetElemList (API_WallID, &amp;amp;wallGuids);
for (UIndex ii = 0; ii &amp;lt; wallGuids.GetSize (); ++ii) {
	API_Element element = {};
	element.header.guid = wallGuids[ii];
	GSErrCode err = ACAPI_Element_Get (&amp;amp;element);
	if (err != NoError)
		continue;

	const API_WallType&amp;amp; 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, &amp;amp;memo);
	if (err != NoError)
		continue;

	if (memo.coords) {
		// (*memo.coords) array contains the outside coordinates
		for (Int32 i = 1; i &amp;lt;= wall.poly.nCoords; i++) {
			(*memo.coords)&lt;I&gt;.x;
			(*memo.coords)&lt;I&gt;.y;
		}
	}

	ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

What do you mean by the center coordinate of the wall?&lt;BR /&gt;
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.</description>
      <pubDate>Wed, 16 Oct 2019 12:48:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264178#M3149</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-10-16T12:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of  a wall？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264179#M3150</link>
      <description>&lt;BLOCKQUOTE&gt;Tibor wrote:&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
Here's a short code snippet for getting the outside coordinates of walls:
&lt;PRE&gt;GS::Array&amp;lt;API_Guid&amp;gt; wallGuids;
ACAPI_Element_GetElemList (API_WallID, &amp;amp;wallGuids);
for (UIndex ii = 0; ii &amp;lt; wallGuids.GetSize (); ++ii) {
	API_Element element = {};
	element.header.guid = wallGuids[ii];
	GSErrCode err = ACAPI_Element_Get (&amp;amp;element);
	if (err != NoError)
		continue;

	const API_WallType&amp;amp; 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, &amp;amp;memo);
	if (err != NoError)
		continue;

	if (memo.coords) {
		// (*memo.coords) array contains the outside coordinates
		for (Int32 i = 1; i &amp;lt;= wall.poly.nCoords; i++) {
			(*memo.coords)&lt;I&gt;.x;
			(*memo.coords)&lt;I&gt;.y;
		}
	}

	ACAPI_DisposeElemMemoHdls (&amp;amp;memo);
}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

What do you mean by the center coordinate of the wall?&lt;BR /&gt;
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.
&lt;/BLOCKQUOTE&gt;

Thanks.&lt;BR /&gt;
wall.begC and wall.endC are the start and the end coordinates of the wall reference line.&lt;BR /&gt;
But If I set the referenceLineLocation of the wall is APIWallRefLine_CoreOutside, are wall.begC and wall.endC also the center coordinates of the reference line of the wall?</description>
      <pubDate>Thu, 17 Oct 2019 03:49:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-can-I-get-the-coordinates-of-a-wall/m-p/264179#M3150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-17T03:49:10Z</dc:date>
    </item>
  </channel>
</rss>

