<?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 Choosing the door from library through Add-On code in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574638#M8841</link>
    <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Wanted to know how we can specify the kind of door that we want through code?&lt;/LI&gt;
&lt;LI&gt;Is it possible to load a set of custom doors/windows through add-on code or should we do it as a different step.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kency_0-1699444528080.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48645iFBD31FE175833120/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kency_0-1699444528080.png" alt="kency_0-1699444528080.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:39:34 GMT</pubDate>
    <dc:creator>kency</dc:creator>
    <dc:date>2024-09-16T12:39:34Z</dc:date>
    <item>
      <title>Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574638#M8841</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Wanted to know how we can specify the kind of door that we want through code?&lt;/LI&gt;
&lt;LI&gt;Is it possible to load a set of custom doors/windows through add-on code or should we do it as a different step.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kency_0-1699444528080.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48645iFBD31FE175833120/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kency_0-1699444528080.png" alt="kency_0-1699444528080.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:39:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574638#M8841</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2024-09-16T12:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574930#M8847</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. If you know the name of the door, then you can use &lt;CODE&gt;ACAPI_LibPart_Search()&lt;/CODE&gt; to find the index of that library part, then get that library part's parameters as well with &lt;CODE&gt;ACAPI_LibPart_GetParams()&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;Put the index into the &lt;CODE&gt;openingBase.libInd&lt;/CODE&gt; member of &lt;CODE&gt;API_WindowType&lt;/CODE&gt;, and add the library part parameters to &lt;CODE&gt;addPars&lt;/CODE&gt; in API_ElementMemo, then call &lt;CODE&gt;ACAPI_Element_Create()&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. There are several ways to do that:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;have the user load the library separately &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;add the library to the list of loaded libraries with &lt;CODE&gt;ACAPI_LibraryManagement_AddLibraries()&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best, Akos&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 07:11:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574930#M8847</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2023-11-10T07:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574931#M8848</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7122"&gt;@Akos Somorjai&lt;/a&gt;&amp;nbsp;. Will try this out.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 07:17:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574931#M8848</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2023-11-10T07:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574932#M8849</link>
      <description>&lt;P&gt;There is a Do_CreateWindow() sample code in Element_Test; this may serve as a starting point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 07:19:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/574932#M8849</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2023-11-10T07:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/576886#M8902</link>
      <description>&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/7122"&gt;@Akos Somorjai&lt;/a&gt;&amp;nbsp;For point 2. Is it possible to add the library file(.lcf) as part of the .bundle or .apx and provide code to load from the file included in the add-on bundle. I was able to load the library given a location from where to pick it up. Something mentioned in this documentation of ArchiCAD 25. Am I looking for something that is not possible to be done.&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-1700651625897.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/49410i9D93DC0AE69BD07E/image-size/large?v=v2&amp;amp;px=999" role="button" title="kency_0-1700651625897.png" alt="kency_0-1700651625897.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 23:11:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/576886#M8902</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2023-11-22T23:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/576964#M8903</link>
      <description>&lt;P&gt;Hi kency,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No, you may only add individual .gsm files as resources. You may ship an .lcf file with the add-on, but then you'll have to add it from code with&amp;nbsp;ACAPI_Environment (APIEnv_AddLibrariesID, ...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 16:08:21 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/576964#M8903</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2023-11-22T16:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/577045#M8905</link>
      <description>&lt;P&gt;Ok, maybe I am stuck at something really simple. I have added an .lcf file in the Resources folder of the Add-On. (updated cmake to include .lcf files).&lt;/P&gt;&lt;P&gt;Now,&lt;/P&gt;&lt;P&gt;How should I ship/bundle it? Is there anything additional that needs to be done for that.&lt;/P&gt;&lt;P&gt;Also, how can I refer to that file in the code? Right now I have been able to load from an absolute path as shown in the snippet below.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;GSErrCode CreateLibrary (void)
{
    IO::Location newLib("~/Desktop/libraries.lcf");
    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;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 05:51:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/577045#M8905</guid>
      <dc:creator>kency</dc:creator>
      <dc:date>2023-11-23T05:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Choosing the door from library through Add-On code</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/577139#M8907</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would ship it together with the add-on, but as a separate file. Ask the user to place the two together into a folder, and then from your code you can get the add-on's location in the file system with&amp;nbsp;ACAPI_GetOwnLocation()&amp;nbsp;and load the .lcf from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best, Akos&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 14:07:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Choosing-the-door-from-library-through-Add-On-code/m-p/577139#M8907</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2023-11-23T14:07:15Z</dc:date>
    </item>
  </channel>
</rss>

