The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

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

By Martin Walter
#307085
I can't get it working.
No icon pictures show in my menu.

But the image is compiled correctly because in the RO directory appears a buttonVekaCreate&96.ico file.

This is my code:
------------------------------------
in RegisterInterface (void):

err = ACAPI_Register_Menu(ID_MENU_STRINGS1, ID_STATUS_STRINGS1, MenuCode_UserDef, MenuFlag_Default);

------------------------------------
in file .grc:

'STR#' ID_MENU_STRINGS1 "Menu strings" {
/* [ 1] */ "WinDoPlan"
/* [ 2] */ "Neues Fenster oder Tür^33000"
}
--------------------------------------
in file ...fix.grc:

'GICN' 33000 "buttonVekaCreate icon" {
"buttonVekaCreate"
}
By Martin Walter
#307122
I'm working on windows and saved the images into the folder ..\RFIX\Images\
as .png
e.g. buttonVekaCreate.png

and my command for compiling the resources is taken from the examples:

..\APIDevelopmentKit23\Tools\Win\ResConv.exe" -m r -D WINDOWS -T W -q utf8 1252 -i "RINT\$(ProjectName).grc" -D _DEBUG -o "$(OutDir)\RO\$(ProjectName).grc.rc2
User avatar
By Ralph Wessel
#307125
Are you able to confirm that the resources and images are correctly embedded in the built add-on?
By Martin Walter
#307135
the file ArchicadPluginFix.grc.rc2 in the RO folder looks like this:

Code: Select all
//nclude "DGDefs.h"

/*---- This file was created by GRC compiler --------------------------------------------*/
/*                                                                                       */
/*     Source file: RFIX\ArchicadPluginFix.grc              Code table: NUL              */
/*                                                                                       */
/*---- Version 2.0 - Windows ------------------------------ (c) 1996-2019 by GRAPHISOFT -*/


#include "MDIDs_APICD.h"

32500 MDID
BEGIN
	8, 0,
	0L + 707017037,
	0L + 4022811608
END

I33000&96	ICON "buttonVekaCreate&96.ico"

I33001&96	ICON "buttonVekaChange&96.ico"

I33002&96	ICON "buttonVekaSettings&96.ico"
-------------------------------------

so the icons are created
and I find the files in the RO folder:
buttonVekaChange&96.ico
buttonVekaCreate&96.ico
buttonVekaSettings&96.ico


what else can I check?
By Martin Walter
#307340
Obviously this is a BUG in Archicad API.
For the second level menu items the icons are working.
But not for the first level:
IconMissing.png
Code: Select all
'STR#' DGTEST_MENU_STRINGSID "Menu strings" {
/* [   ] */		"Test"
/* [   ] */		"DG Functions^10000"
/* [  1] */			"Fill Settings^EL^10000"
/* [  2] */			"Library Browser^EL^10080"
By dushyant
#308042
I am also facing the same issue - not able to get the icon at that level. And looking at ArchiCAD's default menus, icons are visible at that level. So it seems it should be possible..
archicadAPI_menuIcon2.jpg
archicadAPI_menuIcon2.jpg (14.24 KiB) Viewed 1026 times
User avatar
By Ralph Wessel
#308043
I don't think the API allows you to set the icon for the parent item of a sub-menu