cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

Adding Icons to Sub‑Menu Items and Changing Them Dynamically

Corpora Geometrica
Participant

I have two questions about handling menu items through the Archicad API.

 

1. Icons for sub‑menu items
Is it possible to associate an icon with the "Sub-menu Item" provided in the following GRC file snippet?

'STR#' ID_ADDON_MENU "Add-On Menu Strings" {
/* [  ] */ "Main Menu Item"
/* [  ] */ "Sub-menu Item"
/* [ 1] */     "First Command Menu Item^E3^ES^EE^EI^ED^ET^10002"
/* [ 2] */     "Second Command Menu Item^E3^ES^EE^EI^ED^ET^10003"
}​

'STR#' ID_ADDON_MENU_PROMPT "Add-On Menu Strings" {
/* [  ] */ "Main Menu Item"
/* [  ] */ "Sub-menu Item"
/* [ 1] */     "First Command Menu Item"
/* [ 2] */     "Second Command Menu Item"
}​

Writing something like "Sub-menu Item^10001" (or using other escape sequences) has no effect during menu registration, at runtime the menu label simply shows the escape codes as plain text:

GSErrCode __ACDLL_CALL RegisterInterface (void)
{
	GSErrCode err = ACAPI_MenuItem_RegisterMenu (ID_ADDON_MENU, ID_ADDON_MENU_PROMPT, MenuCode_UserDef, MenuFlag_Default);

	return err;
}​

I noticed that Archicad itself shows sub-menu items with icons at the same nesting level as mine (even for other add-ons), but I cannot reproduce this through the API. Are those icons assigned internally?

 

2. Changing icons dynamically 

Is there a way to change dynamically the icons associated with the sub or at least with the command menu items at runtime?

11 REPLIES 11

Thanks for confirming — it is reassuring to know I am not the only one who has run into this. I really appreciate you checking your notes and sharing that context. It does seem this limitation is consistent, even if it is not officially documented.

Hi Ákos,

 

Just checking back to see if you had a chance to look at my reply above. I am still trying to figure out whether it is possible to assign an icon directly to the parent sub‑menu item (like Interface Functions (AutoState)), similar to how it works in the built‑in Archicad menus.

 

Have you been able to confirm if that is doable?

 

Thanks a lot!