[SOLVED] Automatically starting add-on(notification handler)
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-04-01
11:47 PM
- last edited on
‎2023-08-01
01:16 PM
by
Doreena Deng
‎2015-04-01
11:47 PM
Hi
Is it possible to start add-on automatically?
I want to use some events (APINotify_New, APINotify_Open, APINotify_Close).
I've added
If I add menu command handler, Iinitialize method will be executed on user's menu action (first time).
Is it possible to run add-on automatically (start Notification handler) without user action?
Thanks
Lukasz
Is it possible to start add-on automatically?
I want to use some events (APINotify_New, APINotify_Open, APINotify_Close).
I've added
GSErrCode __ACENV_CALL Initialize (void) { ... GSErrCode err = ACAPI_Notify_CatchProjectEvent (API_AllProjectNotificationMask, NotificationHandler); ... }on Initialize and I've added notification handler:
static GSErrCode __ACENV_CALL NotificationHandler (API_NotifyEventID notifID, Int32 param) { switch (notifID) { case APINotify_New: ... case APINotify_Open: ... } }Problem is with Initialize method, it isn't executed automatically after ArchiCAD starts.
If I add menu command handler, Iinitialize method will be executed on user's menu action (first time).
Is it possible to run add-on automatically (start Notification handler) without user action?
Thanks
Lukasz
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-04-07 04:17 PM
‎2015-04-07
04:17 PM
Hi Lukasz,
Please check the return type of your CheckEnvironment function!
I think you should return APIAddon_Preload in CheckEnvironment function. That way Initialize method will be executed when ArchiCAD starts.
Using ACAPI_KeepInMemory could be necessary also.
Regards,
Tibor
Lukasz wrote:
Problem is with Initialize method, it isn't executed automatically after ArchiCAD starts.
Please check the return type of your CheckEnvironment function!
I think you should return APIAddon_Preload in CheckEnvironment function. That way Initialize method will be executed when ArchiCAD starts.
Using ACAPI_KeepInMemory could be necessary also.
Regards,
Tibor
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2015-04-13 10:26 PM
‎2015-04-13
10:26 PM
Great! Thanks Tibor. It is working 
Best Regards
Lukasz

Best Regards
Lukasz