The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (Archicad API, BIMx API, BIMcloud API) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, rmasaki, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

#314479
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.
#314835
Hi,

Yes, you can use ACAPI_Interface (APIIo_SetMenuItemTextID, ...) function for this purpose.
Code: Select all
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.