<?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: Modifying selection-set using a list of guids in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305407#M2256</link>
    <description>&lt;P&gt;Hi, please try to collect the elements to be selected in an array and call ACAPI_Element_Select for multiple elements. The code may be rearranged somehow to achieve this.&lt;/P&gt;&lt;P&gt;Please see the docs/example here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://archicadapi.graphisoft.com/documentation/acapi_element_select" target="_blank" rel="nofollow noopener noreferrer"&gt;https://archicadapi.graphisoft.com/documentation/acapi_element_select&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 10:06:44 GMT</pubDate>
    <dc:creator>Miklos Vegh</dc:creator>
    <dc:date>2021-09-09T10:06:44Z</dc:date>
    <item>
      <title>Modifying selection-set using a list of guids</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305295#M2255</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am trying to modify a selection set, based on a list of guids, by looping through the guid-list and calling the following function for each guid:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void MyPalette::ModifySelection(const GS::UniString&amp;amp; elemGuidStr)
{
	ACAPI_Element_Select({ API_Neig(APIGuidFromString(elemGuidStr.ToCStr().Get())) }, false);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does work, but the problem is it is taking a substantially long time (around 2 min) for a large selection set (around 1900). The same no. of elements gets selected (mouse interaction) in just about a second and a list of selected elements gets generated (though &lt;EM&gt;not&lt;/EM&gt; using ACAPI_Element_Select() , but ACAPI_Selection_Get() ).&lt;/P&gt;
&lt;P&gt;Also the selection happens almost instantly for the same no. of elements with 'Find &amp;amp; Select' (filter: element type 'slab'). Why does it take so long to filter an existing selection set using ACAPI_Element_Select() ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Which method should we use to select elements of, say, a particular type (slab, wall, etc.) ?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 06:29:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305295#M2255</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-09-14T06:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying selection-set using a list of guids</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305407#M2256</link>
      <description>&lt;P&gt;Hi, please try to collect the elements to be selected in an array and call ACAPI_Element_Select for multiple elements. The code may be rearranged somehow to achieve this.&lt;/P&gt;&lt;P&gt;Please see the docs/example here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://archicadapi.graphisoft.com/documentation/acapi_element_select" target="_blank" rel="nofollow noopener noreferrer"&gt;https://archicadapi.graphisoft.com/documentation/acapi_element_select&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 10:06:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305407#M2256</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2021-09-09T10:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying selection-set using a list of guids</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305427#M2257</link>
      <description>&lt;P&gt;You were absolutely right &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/16450"&gt;@Miklos Vegh&lt;/a&gt;&amp;nbsp; !!&lt;/P&gt;&lt;P&gt;It was the huge number of calls to ACAPI_Element_Select(). I was not aware that this function accepted an array of Neigs. I had seen an example which was taking a 'guid' and converting it to 'neig' .. and I kept using it without paying attention to the { } around it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ... My bad..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot again !!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 10:38:19 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Modifying-selection-set-using-a-list-of-guids/m-p/305427#M2257</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2021-09-09T10:38:19Z</dc:date>
    </item>
  </channel>
</rss>

