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

enable / disable menu items with function

Martin Walter
Enthusiast
I would like to enable/disable menu items by a function.

some examples where I need this:
1: only if there is a window or door selected a menu item shall be enabled
2: only if username and password are filled in my settings dialog the other menu items shall be enabled

How is this possible?
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Martin Walter
Enthusiast
Finally I solved it by returning APIAddon_Preload from CheckEnvironment().
Then Initialize() is called at the Start of Archicad.
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD

View solution in original post

4 REPLIES 4
Ralph Wessel
Mentor
The status of menu items can be managed using ACAPI_Interface with APIIo_SetMenuItemFlagsID.
Ralph Wessel BArch
Martin Walter
Enthusiast
The function works, but it's not clear when to call it.

I want some menu items to be enabled/disabled from program start.
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
Solution
Martin Walter
Enthusiast
Finally I solved it by returning APIAddon_Preload from CheckEnvironment().
Then Initialize() is called at the Start of Archicad.
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD

Why did you return APIAddon_Preload from CheckEnvironment() instead of APIAddon_Normal?