Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

load add-on automatically after file is finished opening

Anonymous
Not applicable
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.

I tried this on ArchiCAD 19.

Thanks,
Ian
1 REPLY 1

Erenford
Booster
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

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!