<?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 load add-on automatically after file is finished opening in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/load-add-on-automatically-after-file-is-finished-opening/m-p/242592#M3979</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Right now, our ArchiCAD plugin seems to only be loaded after the user has interacted with the UI for our plugin in ArchiCAD. We'd like some functionality to occur right after a file is loaded without requiring the user to interact with our plugin's menu. Is this possible to do? &lt;BR /&gt;&lt;BR /&gt;We've tried calling ACAPI_Notify_CatchProjectEvent within the RegisterInterface function, but it returns the error APIERR_REFUSEDCMD. &lt;BR /&gt;&lt;BR /&gt;I tried this on ArchiCAD 19. &lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;Ian&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Jul 2023 18:38:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-12T18:38:16Z</dc:date>
    <item>
      <title>load add-on automatically after file is finished opening</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/load-add-on-automatically-after-file-is-finished-opening/m-p/242592#M3979</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Right now, our ArchiCAD plugin seems to only be loaded after the user has interacted with the UI for our plugin in ArchiCAD. We'd like some functionality to occur right after a file is loaded without requiring the user to interact with our plugin's menu. Is this possible to do? &lt;BR /&gt;&lt;BR /&gt;We've tried calling ACAPI_Notify_CatchProjectEvent within the RegisterInterface function, but it returns the error APIERR_REFUSEDCMD. &lt;BR /&gt;&lt;BR /&gt;I tried this on ArchiCAD 19. &lt;BR /&gt;&lt;BR /&gt;Thanks, &lt;BR /&gt;Ian&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Jul 2023 18:38:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/load-add-on-automatically-after-file-is-finished-opening/m-p/242592#M3979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-12T18:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: load add-on automatically after file is finished opening</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/load-add-on-automatically-after-file-is-finished-opening/m-p/242593#M3980</link>
      <description>On CheckEnvironment() return &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;APIAddon_Preload&lt;E&gt;&lt;/E&gt; instead of &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;APIAddon_Normal&lt;E&gt;&lt;/E&gt;. This will load all three functions (CheckEnvironment(), RegisterInterface(), Initialize()) during startup of AC instead of the usual two (CheckEnvironment() and RegisterInterface()).&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;IanTr wrote:&lt;BR /&gt;We've tried calling ACAPI_Notify_CatchProjectEvent within the RegisterInterface function, but it returns the error APIERR_REFUSEDCMD. 
&lt;/BLOCKQUOTE&gt;
There are functions that are not usable in CheckEnvironment() or RegisterInterface(), thats why they return &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;APIERR_REFUSEDCMD&lt;E&gt;&lt;/E&gt;. I'm guessing since these functions start when the project haven't fully loaded yet it won't have any project events to catch.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Initialize() can handle &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_Notify_CatchProjectEvent&lt;E&gt;&lt;/E&gt; (docu says so), but I'm not sure about other functions like ACAPI_Database or ACAPI_Environment.&lt;BR /&gt;
&lt;BR /&gt;
Also don't forget to use &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;ACAPI_KeepInMemory(true)&lt;E&gt;&lt;/E&gt; else it might unload the addon at the wrong time.</description>
      <pubDate>Wed, 08 Nov 2017 09:57:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/load-add-on-automatically-after-file-is-finished-opening/m-p/242593#M3980</guid>
      <dc:creator>Erenford</dc:creator>
      <dc:date>2017-11-08T09:57:40Z</dc:date>
    </item>
  </channel>
</rss>

