cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Archicad C++ API
About Archicad add-on development using the C++ API.

Is there a way to change the menu text while running?

Anonymous
Not applicable
Hi.

I am trying to write a plugin which can update itself. Since there is no way to unload the apx while running, I make the apx to be a "shell" which can dynamic load dll. The dll ontains the implementation. However, I have no idea about RegisterInterface function because the function ACAPI_Register_Menu seems to have something to do with the runtime environment (maybe the stack or registers). I don't want to fix the menu in the "shell" but dynamicly load the related information from dll or txt. So I was wondering if I could change the menu text when ARCHICAD is running? Is there an API like ACAPI_Register_Menu?

Thanks in advance.
1 REPLY 1
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

Yes, you can use ACAPI_Interface (APIIo_SetMenuItemTextID, ...) function for this purpose.
API_MenuItemRef  menuItemRef;
GS::UniString    menuItemStr = "New Text for Menu!!!";

BNZeroMemory (&menuItemRef, sizeof (API_MenuItemRef));
menuItemRef.menuResID = 32500;
menuItemRef.itemIndex = 1;
ACAPI_Interface (APIIo_SetMenuItemTextID, &menuItemRef, nullptr, menuItemStr);
Note, you have to register your menu with ACAPI_Register_Menu in your RegisterInterface function and after that you can change the text of the menu anytime.