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.
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?
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB 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.
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB 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
Software Engineer Speckle Systems
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.
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
Solution
Martin Walter
Enthusiast
Finally I solved it by returning APIAddon_Preload from CheckEnvironment().
Then Initialize() is called at the Start of Archicad.
AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD

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