<?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: store selection sets as .mod in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/store-selection-sets-as-mod/m-p/306492#M81</link>
    <description>&lt;P&gt;Hi ACAPI_Automate Function can help you.&lt;/P&gt;&lt;P&gt;This's example code&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;/* save all elements in the current zoom as module file */

IO::Location            location ("C:\\temp\\CurrentView.mod");
API_SelectionInfo       selectionInfo;
GSErrCode               err = NoError;

if (location.GetStatus () == NoError) {
    BNZeroMemory (&amp;amp;selectionInfo, sizeof (API_SelectionInfo));
    selectionInfo.typeID = API_MarqueeHorBox;
    ACAPI_Database (APIDb_GetZoomID, &amp;amp;selectionInfo.marquee.box, nullptr);
    err = ACAPI_Selection_SetMarquee (&amp;amp;selectionInfo);  /* set the marquee rect to the current zoom */
}

if (err == NoError) {
    err = ACAPI_Automate (APIDo_SaveAsModuleFileID, &amp;amp;location, nullptr);
    BNZeroMemory (&amp;amp;selectionInfo, sizeof (API_SelectionInfo));
    ACAPI_Selection_SetMarquee (&amp;amp;selectionInfo);        /* remove the marquee */
}&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 18 Sep 2021 00:39:43 GMT</pubDate>
    <dc:creator>leilei</dc:creator>
    <dc:date>2021-09-18T00:39:43Z</dc:date>
    <item>
      <title>store selection sets as .mod</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/store-selection-sets-as-mod/m-p/306118#M80</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i got a hint to ask in this forum for a solution to store selection sets as .mod files using some sort of code.&lt;/P&gt;
&lt;P&gt;Unfortunatly with the Python API it is not possible to do that. But the Idea of a Design Forum memver was to use some sort of C++ Add-on or code to do the trick. But i have no clue of programming in C++ so i would be very greatful for hint where i can start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Deas anyone have an idea where to start on how i can store several selection sets as seperate .mod files?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot in advance&lt;/P&gt;
&lt;P&gt;vr&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 10:22:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/store-selection-sets-as-mod/m-p/306118#M80</guid>
      <dc:creator>vr</dc:creator>
      <dc:date>2024-09-26T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: store selection sets as .mod</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/store-selection-sets-as-mod/m-p/306492#M81</link>
      <description>&lt;P&gt;Hi ACAPI_Automate Function can help you.&lt;/P&gt;&lt;P&gt;This's example code&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;/* save all elements in the current zoom as module file */

IO::Location            location ("C:\\temp\\CurrentView.mod");
API_SelectionInfo       selectionInfo;
GSErrCode               err = NoError;

if (location.GetStatus () == NoError) {
    BNZeroMemory (&amp;amp;selectionInfo, sizeof (API_SelectionInfo));
    selectionInfo.typeID = API_MarqueeHorBox;
    ACAPI_Database (APIDb_GetZoomID, &amp;amp;selectionInfo.marquee.box, nullptr);
    err = ACAPI_Selection_SetMarquee (&amp;amp;selectionInfo);  /* set the marquee rect to the current zoom */
}

if (err == NoError) {
    err = ACAPI_Automate (APIDo_SaveAsModuleFileID, &amp;amp;location, nullptr);
    BNZeroMemory (&amp;amp;selectionInfo, sizeof (API_SelectionInfo));
    ACAPI_Selection_SetMarquee (&amp;amp;selectionInfo);        /* remove the marquee */
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 18 Sep 2021 00:39:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/store-selection-sets-as-mod/m-p/306492#M81</guid>
      <dc:creator>leilei</dc:creator>
      <dc:date>2021-09-18T00:39:43Z</dc:date>
    </item>
  </channel>
</rss>

