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?
We've tried calling ACAPI_Notify_CatchProjectEvent within the RegisterInterface function, but it returns the error APIERR_REFUSEDCMD.
On CheckEnvironment() return APIAddon_Preload instead of APIAddon_Normal. This will load all three functions (CheckEnvironment(), RegisterInterface(), Initialize()) during startup of AC instead of the usual two (CheckEnvironment() and RegisterInterface()).
IanTr wrote: We've tried calling ACAPI_Notify_CatchProjectEvent within the RegisterInterface function, but it returns the error APIERR_REFUSEDCMD.
There are functions that are not usable in CheckEnvironment() or RegisterInterface(), thats why they return APIERR_REFUSEDCMD. I'm guessing since these functions start when the project haven't fully loaded yet it won't have any project events to catch.
Initialize() can handle ACAPI_Notify_CatchProjectEvent (docu says so), but I'm not sure about other functions like ACAPI_Database or ACAPI_Environment.
Also don't forget to use ACAPI_KeepInMemory(true) else it might unload the addon at the wrong time.
Archicad 25 5010 INT FULL Visual Studio Professional 2019 Win 10 Pro 64-bit Intel Core i7-4790 CPU @ 3.60GHz