Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 
Developer forum
GDL coding questions, Python and add-on development using the API Dev Kit.

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

Not applicable

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.

Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni

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.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!