<?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 Bundling .gsm files in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/576698#M8900</link>
    <description>&lt;P&gt;Hello Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We would like to bundle a set of gsm files with the Add-On. I got to know from my &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/td-p/574638" target="_blank" rel="noopener"&gt;previous query in the community&lt;/A&gt; that it is possible. The documentation mentions about a Stair Marker Add-On which I could not find in the Examples folder.&amp;nbsp; However, I am not yet clear on how to add a folder while building the bundle. (I am new to C++ as well). Any guidance on how to add a folder to the bundle would be really helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kency_0-1700588992293.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49340iA72C8294AA1E8855/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kency_0-1700588992293.png" alt="kency_0-1700588992293.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been able to successfully load a folder into the library using the below snippet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;GSErrCode CreateLibrary (void)
{
    IO::Location newLib("~/Work/library/types/gsm");
    GSErrCode err;
    err = ACAPI_Environment (APIEnv_AddLibrariesID, &amp;amp;newLib);
    if (err == NoError){
       std::cout &amp;lt;&amp;lt; "New library has been loaded" &amp;lt;&amp;lt; std::endl;
    }
    return err;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:57:04 GMT</pubDate>
    <dc:creator>kency</dc:creator>
    <dc:date>2024-09-16T12:57:04Z</dc:date>
    <item>
      <title>Bundling .gsm files</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/576698#M8900</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We would like to bundle a set of gsm files with the Add-On. I got to know from my &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/td-p/574638" target="_blank" rel="noopener"&gt;previous query in the community&lt;/A&gt; that it is possible. The documentation mentions about a Stair Marker Add-On which I could not find in the Examples folder.&amp;nbsp; However, I am not yet clear on how to add a folder while building the bundle. (I am new to C++ as well). Any guidance on how to add a folder to the bundle would be really helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kency_0-1700588992293.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49340iA72C8294AA1E8855/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kency_0-1700588992293.png" alt="kency_0-1700588992293.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been able to successfully load a folder into the library using the below snippet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;GSErrCode CreateLibrary (void)
{
    IO::Location newLib("~/Work/library/types/gsm");
    GSErrCode err;
    err = ACAPI_Environment (APIEnv_AddLibrariesID, &amp;amp;newLib);
    if (err == NoError){
       std::cout &amp;lt;&amp;lt; "New library has been loaded" &amp;lt;&amp;lt; std::endl;
    }
    return err;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:57:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/576698#M8900</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2024-09-16T12:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bundling .gsm files</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/577183#M8910</link>
      <description>&lt;P&gt;Hi Kency,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is possible, but there are quite a lot of things to take care of. It took me a while to get this working.&lt;/P&gt;
&lt;P&gt;Here are a few thoughts/tips:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You can use &lt;STRONG&gt;ACAPI_Goodies&lt;/STRONG&gt; with &lt;STRONG&gt;APIAny_GetBuiltInLibpartUnIdID&lt;/STRONG&gt; (&amp;lt;= AC26) or &lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___library_part.html#gaeab9cf0bc36c15084c5626b2d51f9011" target="_blank"&gt;&lt;STRONG&gt;ACAPI_LibraryPart_GetBuiltInLibpartUnId&lt;/STRONG&gt;&lt;/A&gt; (AC27) to get the the library part unique id from its resource id. "132" is the resource id in your screenshot.&lt;/LI&gt;
&lt;LI&gt;As you have found, &lt;STRONG&gt;ACAPI_Register_BuiltInLibrary&lt;/STRONG&gt; (&amp;lt;=AC26) or &lt;STRONG&gt;&lt;A href="https://graphisoft.github.io/archicad-api-devkit/group___add_on_integration.html#gaa1b2240430cfcd720a487c8324004890" target="_blank"&gt;ACAPI_AddOnIntegration_RegisterBuiltInLibrary&lt;/A&gt; &lt;/STRONG&gt;(AC27) is important. I think this also requires your &lt;STRONG&gt;CheckEnvironment&lt;/STRONG&gt; function to return &lt;STRONG&gt;APIAddon_Preload&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Make sure that your Resource build step includes the file! You might have to adapt the &lt;STRONG&gt;CompileResources.py&lt;/STRONG&gt; script in case you are using the CMake templates.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Side Note: The stair-maker Add-On is not an available example project. It was shipped a few versions ago with Archicad I think.&lt;BR /&gt;&lt;BR /&gt;Hope that helps,&lt;BR /&gt;Bernd&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 19:51:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/577183#M8910</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-11-23T19:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bundling .gsm files</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/577644#M8925</link>
      <description>&lt;P&gt;1. The 132 in the screenshot is from the documentation. How do we get the id before loading the library part?&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Ok, will check out the APIAddon_Preload&lt;/P&gt;&lt;P&gt;3. Yes, I am using the CMake templates. I made changes in the CMakeList file to include .lcf file as shown in the screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kency_0-1701086769936.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49668iAC193BFD8BDFBF5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kency_0-1701086769936.png" alt="kency_0-1701086769936.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 12:06:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/577644#M8925</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2023-11-27T12:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bundling .gsm files</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/578224#M8937</link>
      <description>&lt;P&gt;1. The &lt;STRONG&gt;resource id&lt;/STRONG&gt; is a number you choose yourself and put into the resource file. So it could be 132 like in the example or any other positive number below &lt;CODE&gt;32767&lt;/CODE&gt; (or something like this, can't find the source for this anymore. I think it was related to maximum repr. of 2^15 somehow which would be max value of short if it's 2 bytes). You can get the &lt;STRONG&gt;library id&lt;/STRONG&gt; from your chosen &lt;STRONG&gt;resource id&lt;/STRONG&gt; as described above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. The way I do it is by including the single .gsm files, not a complete .lcf container. I'm not sure if there's even a way to achieve it with a whole library container. Also as said above, you'll have to make sure that the files are included in the resource compilers output. I'd suggest studying the &lt;STRONG&gt;CompileResources.py&lt;/STRONG&gt; script and checking it's output.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 07:32:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Bundling-gsm-files/m-p/578224#M8937</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-11-30T07:32:14Z</dc:date>
    </item>
  </channel>
</rss>

