<?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: Functions to help find overlapping objects in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225677#M3737</link>
    <description>Wonderful! Thank you both! I think I will combine both your methods!</description>
    <pubDate>Wed, 22 May 2019 08:32:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-22T08:32:42Z</dc:date>
    <item>
      <title>Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225674#M3734</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello guys,&lt;BR /&gt;&lt;BR /&gt;I have to find out if two object elements are overlapping. Are there any functions that can return something that would help me - for example object boundary position or whatever else?&lt;BR /&gt;&lt;BR /&gt;The only one that I found helpful so far is ACAPI_Element_GetHotspots and if there is no easier way I am going to get the boundary hotspots of the objects and think of some algorithm to calculate the objects positions and if they are overlapping. The objects are made and imported by myself so I can put hotspots wherever I want (I think).&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:32:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225674#M3734</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-04T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225675#M3735</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
You can use the &lt;A href="http://archicadapi.graphisoft.com/documentation/apidb_calcboundsid" target="_blank"&gt;APIDb_CalcBoundsID&lt;/A&gt; functionality of &lt;A href="http://archicadapi.graphisoft.com/documentation/acapi_database" target="_blank"&gt;ACAPI_Database&lt;/A&gt; to get a bounding box of the 3D extent of your object.&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
Dénes</description>
      <pubDate>Mon, 20 May 2019 13:45:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225675#M3735</guid>
      <dc:creator>dfintha</dc:creator>
      <dc:date>2019-05-20T13:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225676#M3736</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
You can use ACAPI_Element_GetCollisions to detect collisions between elements (this function is available from API 21).&lt;BR /&gt;
Here is an example from the Element_Test example Add-On, it detects the collisions between the selected elements:
&lt;PRE&gt;void	Do_DetectCollisionsBasedOnSelection (void)
{
	API_SelectionInfo 	selectionInfo;
	API_Neig**			selNeig;
	GSErrCode			err;

	// Get selection
	err = ACAPI_Selection_Get (&amp;amp;selectionInfo, &amp;amp;selNeig, true);
	BMKillHandle ((GSHandle *) &amp;amp;selectionInfo.marquee.coords);

	if (err != NoError &amp;amp;&amp;amp; err != APIERR_NOSEL) {
		BMKillHandle ((GSHandle *) &amp;amp;selNeig);
		ErrorBeep ("ACAPI_Selection_GetInfo", err);
		return;
	}

	if (err == APIERR_NOSEL || selectionInfo.typeID == API_SelEmpty) {
		WriteReport_Alert ("No selected elements");
		return;
	}

	GS::Array&amp;lt;API_Guid&amp;gt; guidList1, guidList2;
	GS::Array&amp;lt;GS::Pair&amp;lt;API_CollisionElem, API_CollisionElem&amp;gt;&amp;gt; collisions;

	for (Int32 i = 0; i &amp;lt; selectionInfo.sel_nElemEdit; i++) {
		guidList1.Push ((*selNeig)&lt;I&gt;.guid);
		guidList2.Push ((*selNeig)&lt;I&gt;.guid);
	}
	BMKillHandle ((GSHandle *) &amp;amp;selNeig);

	// Detect collisions
	API_CollisionDetectionSettings colDetSettings;
	colDetSettings.volumeTolerance = 0.0001;
	colDetSettings.performSurfaceCheck = true;
	colDetSettings.surfaceTolerance = 0.0001;
	err = ACAPI_Element_GetCollisions (guidList1, guidList2, collisions, colDetSettings);
	Do_DumpCollisions (collisions);
}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

Regards,&lt;BR /&gt;
Tibor</description>
      <pubDate>Tue, 21 May 2019 06:38:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225676#M3736</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-05-21T06:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225677#M3737</link>
      <description>Wonderful! Thank you both! I think I will combine both your methods!</description>
      <pubDate>Wed, 22 May 2019 08:32:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225677#M3737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T08:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225678#M3738</link>
      <description>Wow!&lt;BR /&gt;
ACAPI_Element_GetCollisions needs 1 to 3 minutes to return - 3 elements with 3 collisions.&lt;BR /&gt;
My CPU is 100%, MacBook Pro 2017!&lt;BR /&gt;
Is it possible?</description>
      <pubDate>Thu, 23 May 2019 11:29:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225678#M3738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-23T11:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225679#M3739</link>
      <description>&lt;BLOCKQUOTE&gt;n.mihaylov wrote:&lt;BR /&gt;ACAPI_Element_GetCollisions needs 1 to 3 minutes to return - 3 elements with 3 collisions.&lt;/BLOCKQUOTE&gt;

How many elements do you input to ACAPI_Element_GetCollisions function? All elements from your project?</description>
      <pubDate>Fri, 24 May 2019 07:53:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225679#M3739</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2019-05-24T07:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Functions to help find overlapping objects</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225680#M3740</link>
      <description>I check every time and I have only 3 elements in guidList1 and guidList2:&lt;BR /&gt;
&lt;BR /&gt;
ACAPI_Element_GetCollisions (guidList1, guidList2, collisions, colDetSettings);</description>
      <pubDate>Mon, 27 May 2019 06:18:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Functions-to-help-find-overlapping-objects/m-p/225680#M3740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-27T06:18:05Z</dc:date>
    </item>
  </channel>
</rss>

