Macros are what are behind all of your toolbar buttons. They include not only the command string, but also the button, menu and help texts, the tooltip, and of course the image(s) (if any). Each macro also has a “Name” - which presumably is unique and should identify it.
Typing Macros or Window menu>Macros opens the Macro manager dialog. There is a dropdown list to choose between any of the libraries that are currently open. Default will of course always be there. If you have any .rui’s linked they will be separate dropdown entries.
On the right there are buttons New, Duplicate, Delete and Edit.
It all seems logical and well thought out at first glance. But…
After doing some editing, I am finding a bunch of duplicate entries such as the ones below:
First off, if the “Name” is a unique identifier, how is it possible to have exact duplicates with the same name? And how did they get there in the first place?
The duplicates have most likely been caused by my copying buttons from the default library into a toolbar that is actually not part of default, but is instead part of another .rui that I have linked.
If these have been copied to another library, why are the duplicates showing up in default? Well, that’s because despite the fact that the buttons containing the macros have been “copied” from one library to another, they do not bring the macros with them when copied. The macros stay where they were (in default in this case), but the buttons that reference these macros are actually in another library. The button is copied, but the macro in it is only linked. Clear? Crystal.
Also, although some of the duplicated entries have had numbers 01, 02, etc. appended to them, some have not. We have multiple macros with the same name. Which one is which and points to where?
If you create a new button with a custom command it will automatically create a new macro in the library that contains the toolbar where the button is added. If you then decide to delete that button, the macro does not get deleted, it stays in the library. So it’s easy to end up with a bunch of orphaned macros.
There is currently no way to know what macro is associated with a given button or buttons or if it is associated with anything at all. There is also no way to know if a macro corresponds to a left or right mouse button - there can be different ones for each.
Creating a new blank button from scratch and adding the info in the various boxes will create a new macro. For example:
(this has not been copied from anywhere else, everything made from scratch)
Here’s the macro that got created for it in the macro manager:
Why is it named Macro 41? Why isn’t it named MirrorX? Obviously the macro name that Rhino used for reference is neither the text, the tooltip or anything else… But access to setting this real name isn’t exposed in the toolbar button editor, so you end up just with some Macro xx as a name.
Here’s what it looks like when I press the Edit button in the macro manager:
Here the Name field is exposed at least. The menu and help texts also are automatically filled in with the name, not the text or tooltip. Let’s see if I can edit this one.
After an OK, looks good so far in the list:
And, good news, those changes appear to survive a restart of Rhino.
So now I have spent several hours experimenting and trying to understand how the system works. Right now it’s still a tangled mess. I think I now know how to make clean, unlinked buttons that will survive. But it’s a lot of work - make a new blank button (no command), fill in the info in the text boxes, import an image and save it. Then go to the Macro manager and edit the macro name…
Edit: there is another way, maybe even better, I don’t know. Instead of going directly to your toolbar and making a new button, FIRST create the new macro for it directly in the macro manager. Here you have basically the same dialog as with when you use the toolbar button editor, but with a couple of important differences. First is that there is the “Name” field which is not in the button editor - because several buttons might reference the same macro. Second is there is no left and right button edit areas in the macro manager edit box - because a macro is not actually associated with either - you do that later in the button editor. If you are going to make a new button with both left and right functions, you will need to make two macros. Once that is done, you can make your new toolbar button and using the “Select command” option, you can choose your left and right button macros you have just created.