# HELP! Command Macro is needed

**URL:** <https://discourse.mcneel.com/t/help-command-macro-is-needed/5943>\
**Category:** Rhino for Windows\
**Created:** [February 13, 2014, 11:30am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943 "2014-02-13T11:30:07Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 13, 2014, 11:30am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/1 "2014-02-13T11:30:07Z")

</div>

Hi all,  
I need a command macro for a key to toggle wireframe/shaded viewport (rhino option\>keyboard\>command macro).  
Please help me someone.  
Cheers,  
Vlad

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [February 13, 2014, 11:35am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/2 "2014-02-13T11:35:29Z")

</div>

By default, Rhino has  
Ctrl+Alt+X =\> X-Ray  
Ctrl+Alt+S =\> Shaded  
Ctrl+Alt+R =\> Rendered  
Ctrl+Alt+W =\> Wireframe

Look in Options =\> Keyboard (see below)

 ![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/e/5e87dbe8ecda937f898044f0a3b9c004c34a6ebb.jpeg)

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 13, 2014, 12:04pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/3 "2014-02-13T12:04:32Z")

</div>

Yes, I know it, but it takes too much time to press all these combinations. I want to set a toggle macro for (let`s say) F1 key. Once I press F1 the current viewport is shaded, next time it`s wireframe and so on… I don`t know how to make “\_SetDisplayMode” toggle.

---

<div class="post-metadata">

**Author:** ![Peter](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/peter/32/332817_2.png) [@Peter](https://discourse.mcneel.com/u/Peter)\
**Post date:** [February 13, 2014, 12:32pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/4 "2014-02-13T12:32:07Z")

</div>

The easy way out of course would still be F1, F2, F3, F4.

Otherwise you could need to write a script, that either reads out the current type of view and changes based on that, or the script should store a number so it know’s at what part of your rotation it is.

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 13, 2014, 12:36pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/5 "2014-02-13T12:36:33Z")

</div>

I need a shaded/wireframe toggle macro that act as for example F7 to show/hide the grid (the macro is “noecho -\_Grid \_ShowGrid \_ShowGridAxes \_Enter”).  
Is there a simple “macros like” way to do it?

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [February 13, 2014, 12:40pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/6 "2014-02-13T12:40:56Z")

</div>

I recently made a script for exactly this, it [is in this thread](http://discourse.mcneel.com/t/keyboard-shortcuts-toogle-different-functions/5623/2)

–Mitch

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [February 13, 2014, 12:42pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/7 "2014-02-13T12:42:55Z")

</div>

Mitch comes to the rescue. Again 😄

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 13, 2014, 12:54pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/8 "2014-02-13T12:54:37Z")

</div>

Mitch, you’re my hero!)) Thank you again for your help! I assigned you script to F1 and everything works great! By the way - is it possible to assign your script to the key not listed in the rhino options/keyboard list? Let`s say to key X or Z?

---

<div class="post-metadata">

**Author:** ![Helvetosaur](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/helvetosaur/32/635974_2.png) [@Helvetosaur](https://discourse.mcneel.com/u/Helvetosaur)\
**Post date:** [February 13, 2014, 1:03pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/9 "2014-02-13T13:03:45Z")

</div>

Unfortunately, you cannot use single letter key shortcuts - mainly because Rhino thinks you’re typing a command at the command line - so, aside from the function keys and all their possible combinations with ctrl or shift or both, you can have ctrl+single letter combinations - but of course many of these are already used by the standard windows shortcuts. Ctrl + numbers are also available.

You can also program an alias, but that will require an Enter to execute.

Lastly, and not least, beware that a scripted solution, unlike the macroed view commands, has the disadvantage of not being able to be used while you’re inside another command. The script will interrupt any currently running command. Mostly this is not a hindrance, but for display based stuff, it might be.

–Mitch

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 14, 2014, 6:29am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/10 "2014-02-14T06:29:25Z")

</div>

Well) Finally I found the possibility to use single letter key shortcuts - via t-splines hotkeys. I needed shaded/wireframe toggle macro mainly for t-spline modelling, so I have set your script to a key Z and it’s very fast and comfortable now.

 ![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/8/586445c15b0adbd3edcbf6e0db74688d2e2c9a31.jpg)

Well I though that someone could make a useful plug-in for Rhino that would assign any macro/script to any letter key with ready-made presets including some useful scripts like yours at user`s choice. Rhino is really lack of possibility to set up single letter hotkeys. I wish I could toggle top/perspective views with a single letter key shortcuts (not like now by clicking million times on these red car icons)…

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [February 14, 2014, 7:23am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/11 "2014-02-14T07:23:22Z")

</div>

> [@unirevers](#):
>
> Well) Finally I found the possibility to use single letter key shortcuts  
> […]  
> Rhino is really lack of possibility to set up single letter hotkeys.

you could always use mac rhino which has this ability (notice the Join shortcut here)

 ![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/a/8/a8901fdc428992a7c17a38aad777b5233490ac92.png) 

it’s like the wild west with mac and keyboard shortcuts… anything goes… control, option, shift, command- in any combination with any other key (ie- ⌃⌥⇧⌘Z)… or single key…

that said, i changed it back to ⌘J after this screenshot… 😉

rhino (with its command field) isn’t really the best application for using single key shortcuts… it’s better if you use a modifier key or a one letter alias then the spacebar… once you get used to hitting the spacebar to trigger a macro, it’s maybe a thousandth of a second slower than a single key…

---

<div class="post-metadata">

**Author:** ![Peter](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/peter/32/332817_2.png) [@Peter](https://discourse.mcneel.com/u/Peter)\
**Post date:** [February 14, 2014, 8:25am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/12 "2014-02-14T08:25:10Z")

</div>

> [@unirevers](#):
>
> (not like now by clicking million times on these red car icons)

**ctrl+tab** to cycle trough persp, top, etc.

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 14, 2014, 8:59am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/13 "2014-02-14T08:59:44Z")

</div>

To my regret I never experienced MAC so I have nothing to say, worked all my life on Windows-family OS. I like the way how T-Splines has realized it - as a stand-alone plug-in which could be easily turned on/off. In Off statement Rhino uses its own keyboard shortcuts/command line/aliases, in On statement I can use my own hotkeys assigned to any macros/scripts etc.

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 14, 2014, 9:08am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/14 "2014-02-14T09:08:34Z")

</div>

Thanks, Peter, I know that combination, but most of time I toggle between Top and Perspective View. Of course, if I have a bigger display (main is 19` only) or even 2 monitors system that wouldn’t be a problem. I could split the screen or assign every viewport to corresponding full screen monitor… but I can’t so I’m just trying to save time and efforts with all old stuff I have 🙂

---

<div class="post-metadata">

**Author:** ![unirevers](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/unirevers/32/4163_2.png) [@unirevers](https://discourse.mcneel.com/u/unirevers)\
**Post date:** [February 14, 2014, 9:18am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/15 "2014-02-14T09:18:27Z")

</div>

Hi, Mitch! Is it possible to somehow modify your script to toggle between 2 commands?

'\_SetView \_World Top

and

'SetView World Top  
’SetView World Perspective

Best regards,  
Vlad

---

<div class="post-metadata">

**Author:** ![dannyboyesiom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dannyboyesiom/32/747690_2.png) [@dannyboyesiom](https://discourse.mcneel.com/u/dannyboyesiom)\
**Post date:** [February 14, 2014, 9:26am UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/16 "2014-02-14T09:26:15Z")

</div>

I use the Viewport tabs to great effect when changing between them.

 ![](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/1/61aec68b9aad46e7dc7725db60f69a0c6043d88f.png)

These change the viewport you are using where as the Red Car Icons change the view the viewport is using.

---

<div class="post-metadata">

**Author:** ![jeff\_hammond](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeff_hammond/32/768846_2.png) [@jeff\_hammond](https://discourse.mcneel.com/u/jeff_hammond)\
**Post date:** [February 14, 2014, 4:37pm UTC](https://discourse.mcneel.com/t/help-command-macro-is-needed/5943/17 "2014-02-14T16:37:40Z")

</div>

> [@unirevers](#):
>
> To my regret I never experienced MAC so I have nothing to say, worked all my life on Windows-family OS.

srry… that was more of a late-nite bad joke thing… (switch OS to use one key shortcuts – it was funny to me then and still sort of funny now but i get it that i have a weird sense of humor 😉 )

the stuff i said about one key shortcuts in rhino still stands though… it’s as if you’re fighting the UI in order to use them.
