License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…
2025-05-06 04:08 PM - edited 2025-05-06 04:17 PM
Hello,
I'm exploring whether it's possible to catch Archicad events right from Archicad startup, rather than only after triggering a command via the MenuCommandHandler method.
I've been using the methods Do_CatchProjectEvent and NotificationHandler from the sample Project_Observer.cpp provided in the API Development Kit 28.4001\Examples\Notification_Manager. Currently, I'm calling Do_CatchProjectEvent within the RegisterInterface method, but it doesn't seem to work. Specifically, the dialog triggered by ACAPI_WriteReport in NotificationHandler never appears.
It does work when I call Do_CatchProjectEvent from within a command in MenuCommandHandler.
My ultimate goal is to have Archicad generate LibraryPart (GSM) files in response to requests from an external application. To do this, I want to launch Archicad automatically and determine when it's safe to begin code execution for GSM generation (ensuring Archicad isn't busy to avoid any potential crashes). Maybe there is a method to ask Archicad if the environment is safe?
Thanks
Solved! Go to Solution.
2025-05-07 09:01 AM
Hi Lorenzo,
You need to call ACAPI_ProjectOperation_CatchProjectEvent (which is the function call in Do_CatchProjectEvent you were referring to) inside of the Initialize function. Calling it in RegisterInterface doesn't work.
I think the "earliest" notification you can get are APINotify_New, APINotify_NewAndReset and APINotify_Open. So whenever a project is opened/newly created.
For your ultimate goal I have two suggestions/questions:
Hope that helps,
Bernd
2025-05-07 09:42 AM
Hi,
In addition.
If you want to load an addon at start of archicad, you need to return APIAddon_Preload from CheckEnvirinment function.
PS:
And there is related function ACAPI_KeepInMemory.
I think, calls of ACAPI_ProjectOperation_CatchProjectEvent in the Initialize function will keep the addon in memory already.
So in this case just for info.
2025-05-07 09:01 AM
Hi Lorenzo,
You need to call ACAPI_ProjectOperation_CatchProjectEvent (which is the function call in Do_CatchProjectEvent you were referring to) inside of the Initialize function. Calling it in RegisterInterface doesn't work.
I think the "earliest" notification you can get are APINotify_New, APINotify_NewAndReset and APINotify_Open. So whenever a project is opened/newly created.
For your ultimate goal I have two suggestions/questions:
Hope that helps,
Bernd
2025-05-07 09:42 AM
Hi,
In addition.
If you want to load an addon at start of archicad, you need to return APIAddon_Preload from CheckEnvirinment function.
PS:
And there is related function ACAPI_KeepInMemory.
I think, calls of ACAPI_ProjectOperation_CatchProjectEvent in the Initialize function will keep the addon in memory already.
So in this case just for info.
2025-05-09 08:19 AM
Thanks for your very useful informations ! The LPXML_Converter is the perfect tool for what I need, I don't even need to "pilot" Archicad !
Is it possible to debug GDL script using LPXML_Converter ?
Hi@Oleg,
Thank you for your useful addition !
2025-05-09 02:16 PM
Glad to read that the information helps you 🙂
Unfortunately the LPXML_Converter can't really be used for debugging scripts to my understanding.
If you end up using it, I recommend to use the "hsf" format. I think it's the easiest to work with.
2025-05-13 11:55 AM
Hello again @Bernd - Archi-XT,
There is no debugger in LPXML_Converter, but is there a way to debug GDL I write using Archicad API with ACAPI_LibraryPart_WriteSection ?
Globally, is there a way to debug GDL script using code ?
Thank you
2025-05-13 04:29 PM
I don't think there is any unfortunately! At least I'm not aware of any.