<?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 Get information of current selection in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-information-of-current-selection/m-p/272091#M3520</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;How can I get the 'guids' of the current selection (multiple element types) ?&lt;BR /&gt;Can I use ACAPI_Element_GetElemList ?&lt;/DIV&gt;</description>
    <pubDate>Tue, 04 Oct 2022 14:47:41 GMT</pubDate>
    <dc:creator>SajW</dc:creator>
    <dc:date>2022-10-04T14:47:41Z</dc:date>
    <item>
      <title>Get information of current selection</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-information-of-current-selection/m-p/272091#M3520</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;How can I get the 'guids' of the current selection (multiple element types) ?&lt;BR /&gt;Can I use ACAPI_Element_GetElemList ?&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:47:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Get-information-of-current-selection/m-p/272091#M3520</guid>
      <dc:creator>SajW</dc:creator>
      <dc:date>2022-10-04T14:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get information of current selection</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Get-information-of-current-selection/m-p/272092#M3521</link>
      <description>You can use ACAPI_Selection_Get to get the current selection:
&lt;PRE&gt;static GS::Array&amp;lt;API_Guid&amp;gt;	GetSelectedElements (bool assertIfNoSel /* = true*/, bool onlyEditable /*= true*/)
{
	GSErrCode            err;
	API_SelectionInfo    selectionInfo;
	API_Neig             **selNeigs;

	err = ACAPI_Selection_Get (&amp;amp;selectionInfo, &amp;amp;selNeigs, onlyEditable);
	BMKillHandle ((GSHandle *)&amp;amp;selectionInfo.marquee.coords);
	if (err == APIERR_NOSEL || selectionInfo.typeID == API_SelEmpty) {
		if (assertIfNoSel) {
			DGAlert (DG_ERROR, "Error", "Please select an element!", "", "Ok");
		}
	}

	if (err != NoError) {
		BMKillHandle ((GSHandle *)&amp;amp;selNeigs);
		return GS::Array&amp;lt;API_Guid&amp;gt;();
	}

	UInt32 nSel = BMGetHandleSize ((GSHandle)selNeigs) / sizeof (API_Neig);

	GS::Array&amp;lt;API_Guid&amp;gt; guidArray;
	for (UInt32 i = 0; i &amp;lt; nSel; ++i) {
		guidArray.Push ((*selNeigs)&lt;I&gt;.guid);
	}

	BMKillHandle ((GSHandle *)&amp;amp;selNeigs);

	return guidArray;
}&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2018 08:51:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Get-information-of-current-selection/m-p/272092#M3521</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2018-12-20T08:51:10Z</dc:date>
    </item>
  </channel>
</rss>

