Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

API Examples

poco2013
Mentor
Having trouble compiling Examples DG_Test and Panel-Test.

They compile and load OK and show up in the ADD ON Manager as being available but do not show in the TEST menu as programed in the .grc file. I get no compile errors or warnings. The required links in the functions: Initialize, Register Interface and MenuCommandHandler look about the same as the other examples.

Using VS Community 2017 with included SDK 17134 and the latest 18362 loaded. - both SDKs compile the same.

Have compiled 13 other examples with same settings and all work OK and all menus show up and work. only having trouble with these two.

Archicad 23, Windows 10

EDIT: Panel test is working correctly -- My Bad - DG_Test is not The DG_Test menu item appends a '^EL' onto the end of the menu items. The instructions read:

"^EL The command is enabled above layout and master layout windows "

But I have no idea what that means

Any one else try these??
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Gerry,

DG_Test is a special Add-On, because it shows an example for "how to create multi-language Add-On". For further informations please read this blog post: http://archicadapi.graphisoft.com/how-to-create-multi-language-add-on

That means the build result of DG_Test Add-On is not only an APX file on Windows, but it creates a MUI file also. That MUI file contains the language dependent resources of the Add-On, just like the menu item strings.
My guess is you copied the DG_Test.apx file to your ARCHICAD's Add-Ons folder, but you did not copy the MUI file which is inside the "en-US" folder. If ARCHICAD doesn't find the MUI file for the Add-On, then it won't be able to load the resource strings and won't be able to show the menu of the Add-On.
Please copy the "en-US" folder (containing the DG_Test.apx.mui file) next to the DG_Test.apx in your Add-Ons folder.

Regards,
Tibor

View solution in original post

4 REPLIES 4
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Panel_Test does not register menus in RegisterInterface function, so it won't have any menu items in Test menu.
That example Add-On registers custom panels into Wall Settings dialog, Material Settings dialog and Wall Info box.
You have to set those custom panels visible in the Work Environment dialog to test them.
poco2013 wrote:
The DG_Test menu item appends a '^EL' onto the end of the menu items. The instructions read:

"^EL The command is enabled above layout and master layout windows "

But I have no idea what that means
If you register a menu item, by default it will be enabled only when the 2D Floor Plan window is active. If you switch to 3D window or a Layout window, your menu item will be disabled (grayed out).
To enable your menu item in 3D window you can use the E3 control code and to enable your menu item in Layout window you should use EL control code. Please find all other control codes in the documentation.
Use those control codes after a '^' character at the end of the menu item strings in your GRC resource.
poco2013
Mentor
Thanks Tibor:

As to Panel_Test - Your right - I did not have them enabled in 'Work Environment'.

The problem with DG_Test is that its not registering in the top 'Test' menu at all and Stays blank..

EDIT: DG_Test is listed as OK in the AddONManager

I did double check the control codes ^EC and ^EL by writing a one line addon and they are working as described. The problem with DG_Test is that it does not even appear in the top menu, So enable/disable is not the problem . As far as I can see, the code registers itself properly using the MenuCode_UserDef attribute.

Out of curiosity, I rechecked the compiled 22 version in 22 and had the same problem.

any chance you could double check?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Gerry,

DG_Test is a special Add-On, because it shows an example for "how to create multi-language Add-On". For further informations please read this blog post: http://archicadapi.graphisoft.com/how-to-create-multi-language-add-on

That means the build result of DG_Test Add-On is not only an APX file on Windows, but it creates a MUI file also. That MUI file contains the language dependent resources of the Add-On, just like the menu item strings.
My guess is you copied the DG_Test.apx file to your ARCHICAD's Add-Ons folder, but you did not copy the MUI file which is inside the "en-US" folder. If ARCHICAD doesn't find the MUI file for the Add-On, then it won't be able to load the resource strings and won't be able to show the menu of the Add-On.
Please copy the "en-US" folder (containing the DG_Test.apx.mui file) next to the DG_Test.apx in your Add-Ons folder.

Regards,
Tibor
poco2013
Mentor
Thanks Again Tibor:

I copied over the en directory and file and it is working now. Also thanks for the reference, which I missed even in 22.

Going to have to play with this some more -- Looks like a great feature.

Many Thanks for pointing me in the right direction (again).
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27