BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

Add-On Menu disabled after file close

Anonymous
Not applicable
Hi, my add on menu is disabled after a file close.
I added a notification handler to check the menu on file close and it reports the menu as enabled.

How can I have my add-on menu enabled even when there is no file open, please?

Currently I'm working with AC13 but about to shift to AC15.
5 REPLIES 5
Ralph Wessel
Mentor
GDefina wrote:
Hi, my add on menu is disabled after a file close.
I added a notification handler to check the menu on file close and it reports the menu as enabled.
How can I have my add-on menu enabled even when there is no file open, please?
That's standard behaviour as far as I know. I don't know of a method to keep the menu enabled when no project is open. You want to be careful even if you find a way because most API commands won't function without an open project.
Ralph Wessel BArch
Anonymous
Not applicable
Thanks.
That's unfortunate as my add-on interfaces with a Document Management System and I wanted the Open function to be able to work after a document had been closed.
Anonymous
Not applicable
When the project is displaying something other than the floor plan the add-on menu is disabled. Is there a mechanism to have the menu visible regardless of what is being viewed?

Thanks for your help.
Ralph Wessel
Mentor
GDefina wrote:
When the project is displaying something other than the floor plan the add-on menu is disabled. Is there a mechanism to have the menu visible regardless of what is being viewed?
Yes. You can append codes to menu resources to specify when the menu is enabled, e.g. if the menu should be enabled when something is selected:
'STR#' 32500  "My menu" {
	/*[ 1]*/	"My Item…^S"
}
There is a code for every drawing/window type too. You can find an example and a full list of codes in the Required Resources section of the API documentation.
Ralph Wessel BArch
Anonymous
Not applicable
Thanks Ralph, I saw those codes, but I couldn't work out the relationship between the windows, the codes and the reality of the display.

I'll experiment and see what works.
Learn and get certified!