Toggling different commands

Hello there,

I was wondering if it’s possible to toggle between different commands with the same keys - say for example using ctrl+1 for pointson and points off, or between !_Zoom _All _ Selected and '_Zoom _All _Extents.
Or du you have to assign them to different ones?

Thank you!

Hi Pelle,

It is not straight-forward, but possible to achieve with some help from a simple script.

Please see attached sample script to implement Zoom commands toggle.
Save it on your HD and drag-and-drop into Rhino - it will add “ZoomToggle” command alias.
From now on, you can assign “ZoomToggle” command to a key shortcut and it should toggle between the two zoom commands you mentioned from a single key shortcut.

ZoomToggle.rvb (557 Bytes)

See if you can modify this script and repeat the above to make it work with other command pairs you need.



Thanks a lot Jarek!
I tried with points on/off and it works fine.

Will save me a couple of mouse buttons!

Great, glad it works for you.

In case you or anyone else is interested in this functionality (I like the idea, made a few pairs like that for myself already!), here is a tool that automates the creation of the 2-command toggle alias: just enter command A, command B and the Alias name and the script will be automatically created. Once the resulting script is dragged into Rhino, Alias will be added and it can be assigned to button, key shortcut, etc…

TwoCommandToggleAliasCreator.rvb (1.7 KB)



EDIT: Here is an updated version - no need to drag-and-drop the script anymore - the shortcut is added automatically now and loaded at Rhino startup:
TwoCommandToggleAliasCreator.rvb (1.7 KB)

Very nice.
Will be useful!