Menu problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-04-28 08:59 AM - last edited on ‎2023-07-12 09:08 PM by Doreena Deng
‎2016-04-28
08:59 AM
I've got the following basic code for loading the menu strings of my add-on:
where: PrintError() prints error detail to debug view even on release mode).
I release build it. It runs okay on another PCs except 1. Although it loads the first string, the second string does not load on that PC. But when I reload the add-on, it runs okay. Also, the PrintError() prints a NoError.
What causes this problem and how to fix it?
GSErrCode err = NoError; err = ACAPI_Register_Menu(ID_MENU_STR_1, ID_MENU_STA_1, MenuCode_UserDef, MenuFlag_SeparatorBefore); PrintfError(__LINE__, err); //else //if (err == NoError) err = ACAPI_Register_Menu(ID_MENU_STR_2, ID_MENU_STA_2, MenuCode_UserDef, MenuFlag_InsertIntoSame); PrintfError(__LINE__, err);
I release build it. It runs okay on another PCs except 1. Although it loads the first string, the second string does not load on that PC. But when I reload the add-on, it runs okay. Also, the PrintError() prints a NoError.
What causes this problem and how to fix it?
~ReignBough~
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
ARCHICAD 26 INT (from AC18)
Windows 11 Pro, AMD Ryzen 7, 3.20GHz, 32.0GB RAM, 64-bit OS
Labels:
- Labels:
-
Add-On (C++)
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-05-13 02:18 PM
‎2016-05-13
02:18 PM
Hi,
Sorry i can't help you.
I wanted just to say that i have many problems with menu item creation.
When i add menu items once, build & run my addon...then i change the menu items (names, positions via the MenuCode_xxx) the menu won't change. I try rebuilding everything, compile the grc individually. Nothing changes.
I turn cray with this. Loosing a lot of time.
So there is a problem for sure...but what.
Sorry i can't help you.
I wanted just to say that i have many problems with menu item creation.
When i add menu items once, build & run my addon...then i change the menu items (names, positions via the MenuCode_xxx) the menu won't change. I try rebuilding everything, compile the grc individually. Nothing changes.
I turn cray with this. Loosing a lot of time.
So there is a problem for sure...but what.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-05-17 04:31 AM
‎2016-05-17
04:31 AM
gehairing wrote:Changes in the menu / .grc files will not show up immediately with a simple build. You need to rebuild the addon (using Build sometimes doesn't recompile the .grc files), THEN close your ArchiCAD and open it again (close everything to make sure). Either that or remove and reattach the addon.
When i add menu items once, build & run my addon...then i change the menu items (names, positions via the MenuCode_xxx) the menu won't change. I try rebuilding everything, compile the grc individually. Nothing changes.
The menu stuff is only updated during addon's CheckEnvironment / RegisterInterface, which loads during ArchiCAD's startup or when addon is attached.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-05-17 08:15 AM
‎2016-05-17
08:15 AM
Erenford wrote:Thanks a lot for your answer.
Changes in the menu / .grc files will not show up immediately with a simple build. You need to rebuild the addon (using Build sometimes doesn't recompile the .grc files), THEN close your ArchiCAD and open it again (close everything to make sure). Either that or remove and reattach the addon.
The menu stuff is only updated during addon's CheckEnvironment / RegisterInterface, which loads during ArchiCAD's startup or when addon is attached.
Yes of course i rebuild completely the plugin because the simple build only rebuilds the code. After rebuild the plugin is regenerated and copied in the extension folder and then Archicad is relaunched and the loading process is made again.
I use this code to put my menu in the "palettes" menu :
// Interface definitions GSErrCode __ACDLL_CALL RegisterInterface (void) { InitializeLanguageCodes(); GSErrCode err = ACAPI_Register_Menu (12500, 12520, MenuCode_Palettes, MenuFlag_Default);
And this is my .grc for the menu :
'STR#' 12500 "Strings for the Menu" { /* [ ] */ "Show/Hide palette^E3^E2" }Before last week i had the same plugin working and the menu items where added to the "MenuCode_GDLObjects" menu. This worked well.
Now i have changed the user interface and i use a palette for the commands. So i wanted to change my menus and simply add one item for show/hide the palette in the palette menu (MenuCode_Palettes).
But my new "Show/Hide" menu item still appears in the "MenuCode_GDLObjects" menu. It seem's something is memorized somewhere. Very very strange.
I have searched in the registry for some ID's, i have of course restared the computer. Nothing changes.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-05-17 09:02 AM
‎2016-05-17
09:02 AM
gehairing wrote:Sure you deleted traces of your old code in RegisterInterface or in grc?
Before last week i had the same plugin working and the menu items where added to the "MenuCode_GDLObjects" menu. This worked well.
Now i have changed the user interface and i use a palette for the commands. So i wanted to change my menus and simply add one item for show/hide the palette in the palette menu (MenuCode_Palettes).
But my new "Show/Hide" menu item still appears in the "MenuCode_GDLObjects" menu. It seem's something is memorized somewhere. Very very strange.
Try to delete your local ArchiCAD cache, located in
You can also try the one in
Of course try to backup before deleting in case it gets screwy
Anyway we're getting a little off-topic so I'll stop now.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2016-05-17 09:44 AM
‎2016-05-17
09:44 AM
That was it. I've removed the cache and everything works
Thank's a lot and sorry if this was off topic (maybe not😉 )
Thank's a lot and sorry if this was off topic (maybe not