<?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: ACAPI_LibPart_RegisterAll only registers the last libPart in the array in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/582389#M9045</link>
    <description>&lt;P&gt;Used below code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;for (const IO::Location&amp;amp; location : textureFileNewLocationList) {
        IO::Location* nonConstLocation = new IO::Location(location.ToDisplayText());

        API_LibPart libPart = {};
        BNZeroMemory (&amp;amp;libPart, sizeof (API_LibPart));
        libPart.typeID = APILib_PictID;
        libPart.location = nonConstLocation;

        libParts.Push(libPart);
    }&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 03 Jan 2024 06:16:58 GMT</pubDate>
    <dc:creator>roni</dc:creator>
    <dc:date>2024-01-03T06:16:58Z</dc:date>
    <item>
      <title>ACAPI_LibPart_RegisterAll only registers the last libPart in the array</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/579095#M8966</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I was trying to register a list of libParts, later to create Surfaces using them.&lt;/SPAN&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;GS::Array&amp;lt;API_LibPart&amp;gt; libParts;    
for (const auto&amp;amp; location : textureFileNewLocationList) {
        
        IO::Location nonConstLocation = location;
        std::cout&amp;lt;&amp;lt;UNISTR_TO_LIBXLSTR(nonConstLocation.ToDisplayText()) &amp;lt;&amp;lt; std::endl;
        
        API_LibPart libPart;
        BNZeroMemory (&amp;amp;libPart, sizeof (API_LibPart));
        
        libPart.typeID = APILib_PictID;
        libPart.location = &amp;amp;nonConstLocation;
        
        libParts.Push (libPart);
    }
err = ACAPI_LibPart_RegisterAll (&amp;amp;libParts);&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;
&lt;P&gt;&lt;SPAN&gt;In the above code &lt;/SPAN&gt;textureFileNewLocationList&lt;SPAN&gt; is a array of file locations of images I plan to use. After executing the code, it registers only the last element of the array. In my case I have 55 libParts to register, only 55th have successfully registered.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I go and check Files → Library and Objects → Library Manager, the box will show one surface got loaded, other 54 were missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;A manual Reload in the ArchiCAD will load all the libParts&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using ArchiCAD 25&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:44:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/579095#M8966</guid>
      <dc:creator>roni</dc:creator>
      <dc:date>2024-09-16T12:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_LibPart_RegisterAll only registers the last libPart in the array</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/579114#M8968</link>
      <description>&lt;P&gt;Update&lt;BR /&gt;I used below code, which loads the Lib Parts of mine but deletes all other default libraries provided by ArchiCAD&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    API_LibraryInfo libInfo;
    IO::Location outputLoc (GetSpecialFolderLocation (API_ApplicationFolderID), IO::Name ("/Users/roni/Library/Application Support/GRAPHISOFT/AutoSave-25-2"));
    libInfo.location = outputLoc;
    GS::Array&amp;lt;API_LibraryInfo&amp;gt;    lip = {libInfo};
    err = ACAPI_Automate (APIDo_LoadLibrariesID, &amp;amp;lip);
    if (err != NoError) {
        ACAPI_WriteReport ("Error in APIDo_LoadLibrariesID", true);
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 09:37:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/579114#M8968</guid>
      <dc:creator>roni</dc:creator>
      <dc:date>2023-12-06T09:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: ACAPI_LibPart_RegisterAll only registers the last libPart in the array</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/582389#M9045</link>
      <description>&lt;P&gt;Used below code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;for (const IO::Location&amp;amp; location : textureFileNewLocationList) {
        IO::Location* nonConstLocation = new IO::Location(location.ToDisplayText());

        API_LibPart libPart = {};
        BNZeroMemory (&amp;amp;libPart, sizeof (API_LibPart));
        libPart.typeID = APILib_PictID;
        libPart.location = nonConstLocation;

        libParts.Push(libPart);
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 03 Jan 2024 06:16:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/ACAPI-LibPart-RegisterAll-only-registers-the-last-libPart-in-the/m-p/582389#M9045</guid>
      <dc:creator>roni</dc:creator>
      <dc:date>2024-01-03T06:16:58Z</dc:date>
    </item>
  </channel>
</rss>

