<?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 to get the zone element that contains another zone element？ in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278046#M3318</link>
    <description>I don't know of an API function that will automatically retrieve the relationship between zones. But you could do the following:&lt;BR /&gt;
1) Get the selected zone&lt;BR /&gt;
2) Get the polygon of the selected zone&lt;BR /&gt;
3) Iterate through the model database to search for zone elements&lt;BR /&gt;
4) For each zone found, test if its polygon encloses the selected zone polygon</description>
    <pubDate>Mon, 09 Dec 2019 13:08:09 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2019-12-09T13:08:09Z</dc:date>
    <item>
      <title>how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278042#M3314</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi.&lt;BR /&gt;I want to query the zone element that contains the selected zone element.&lt;BR /&gt;Is there any API can solve it？&lt;BR /&gt;&lt;BR /&gt;How to get the outer zone that contains the inner zone? The inner zone is known.&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Sep 2022 07:50:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278042#M3314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-29T07:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278043#M3315</link>
      <description>Hi.&lt;BR /&gt;
Is there any API that can get different spatial relationship between elements?&lt;BR /&gt;
Thanks.</description>
      <pubDate>Mon, 09 Dec 2019 06:56:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278043#M3315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-09T06:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278044#M3316</link>
      <description>Hello DevJeer,&lt;BR /&gt;
&lt;BR /&gt;
Between one Zone and other elements we just have to create a schedule to show the relation between them&lt;BR /&gt;
But if there are 2 Zones at the same place, an element into them can not know with which be linked (and only one of them).&lt;BR /&gt;
So I think if the are two zones in a same area... They are probably not able to communicate together &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
It is like a "mother zone" and linked "daughter element".</description>
      <pubDate>Mon, 09 Dec 2019 11:27:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278044#M3316</guid>
      <dc:creator>Christophe Fortineau</dc:creator>
      <dc:date>2019-12-09T11:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278045#M3317</link>
      <description>&lt;BLOCKQUOTE&gt;Christophe wrote:&lt;BR /&gt;
Hello DevJeer,&lt;BR /&gt;
&lt;BR /&gt;
Between one Zone and other elements we just have to create a schedule to show the relation between them&lt;BR /&gt;
But if there are 2 Zones at the same place, an element into them can not know with which be linked (and only one of them).&lt;BR /&gt;
So I think if the are two zones in a same area... They are probably not able to communicate together &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
It is like a "mother zone" and linked "daughter element".
&lt;/BLOCKQUOTE&gt;

Thanks.&lt;BR /&gt;
Are there other methods that can get the spatial relationship of two polygon？</description>
      <pubDate>Mon, 09 Dec 2019 11:38:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278045#M3317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-09T11:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278046#M3318</link>
      <description>I don't know of an API function that will automatically retrieve the relationship between zones. But you could do the following:&lt;BR /&gt;
1) Get the selected zone&lt;BR /&gt;
2) Get the polygon of the selected zone&lt;BR /&gt;
3) Iterate through the model database to search for zone elements&lt;BR /&gt;
4) For each zone found, test if its polygon encloses the selected zone polygon</description>
      <pubDate>Mon, 09 Dec 2019 13:08:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278046#M3318</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2019-12-09T13:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278047#M3319</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;
I don't know of an API function that will automatically retrieve the relationship between zones. But you could do the following:&lt;BR /&gt;
1) Get the selected zone&lt;BR /&gt;
2) Get the polygon of the selected zone&lt;BR /&gt;
3) Iterate through the model database to search for zone elements&lt;BR /&gt;
4) For each zone found, test if its polygon encloses the selected zone polygon
&lt;/BLOCKQUOTE&gt;

Thanks.&lt;BR /&gt;
'4) For each zone found, test if its polygon encloses the selected zone polygon'&lt;BR /&gt;
Is there any api method that can do this?</description>
      <pubDate>Tue, 10 Dec 2019 00:57:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278047#M3319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-10T00:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278048#M3320</link>
      <description>I'm sure there is. We started our element and polygon classes a long time ago, so I haven't delved into the ARCHICAD API for that. If we're testing whether a zone encloses another polygon, we just do something like this:&lt;PRE&gt;bool isParent(const ZoneElement&amp;amp; testZone, const Polygon&amp;amp; childPolygon)
{
	return ((testZone.getPolygon() != nullptr) &amp;amp;&amp;amp;			//Check the test zone has a valid polygon
		testZone.getPolygon()-&amp;gt;encloses(childPolygon));		//…and the test zone polygon encloses the child polygon
}&lt;/PRE&gt;
I know the API has built up a comprehensive geometry library over the years - maybe one of the GS guys could point you to the right function?</description>
      <pubDate>Tue, 10 Dec 2019 11:07:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278048#M3320</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2019-12-10T11:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278049#M3321</link>
      <description>&lt;BLOCKQUOTE&gt;Ralph wrote:&lt;BR /&gt;
I'm sure there is. We started our element and polygon classes a long time ago, so I haven't delved into the ARCHICAD API for that. If we're testing whether a zone encloses another polygon, we just do something like this:&lt;PRE&gt;bool isParent(const ZoneElement&amp;amp; testZone, const Polygon&amp;amp; childPolygon)
{
	return ((testZone.getPolygon() != nullptr) &amp;amp;&amp;amp;			//Check the test zone has a valid polygon
		testZone.getPolygon()-&amp;gt;encloses(childPolygon));		//…and the test zone polygon encloses the child polygon
}&lt;/PRE&gt;
I know the API has built up a comprehensive geometry library over the years - maybe one of the GS guys could point you to the right function?
&lt;/BLOCKQUOTE&gt;

Thanks.&lt;BR /&gt;
Whether it is possible to solve this problem by Geometry API？</description>
      <pubDate>Wed, 11 Dec 2019 01:13:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278049#M3321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-11T01:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the zone element that contains another zone element？</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278050#M3322</link>
      <description>There isn't documentation for this, so I can't say for sure. But looking through the headers, this method in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;CustomPolygon2D&lt;E&gt;&lt;/E&gt; class looks promising:&lt;PRE&gt;// Returns the relative position of the Polygon and the Polygon parameter
RelativePosition GetPosition (const CustomPolygon2D&amp;amp; poly, Boundary boundaries, DetailedRelativePosition* detailed = nullptr) const;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Dec 2019 09:15:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/how-to-get-the-zone-element-that-contains-another-zone-element/m-p/278050#M3322</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2019-12-11T09:15:45Z</dc:date>
    </item>
  </channel>
</rss>

