# Viewport commands

**URL:** https://forum.highend3d.com/t/viewport-commands/7920
**Category:** Maya
**Tags:** mel
**Created:** [December 1, 1999, 11:29am UTC](https://forum.highend3d.com/t/viewport-commands/7920 "1999-12-01T11:29:25Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![maryjane](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@maryjane](https://forum.highend3d.com/u/maryjane)
#### Post date: [December 1, 1999, 11:29am UTC](https://forum.highend3d.com/t/viewport-commands/7920/1 "1999-12-01T11:29:25Z")

</div>

hello all. i have a simple problem. i want to make hotkeys that affect viewport specific commands. for example, the show menu; show surf, curves, etc, etc. but i can't find the mel command to apply it to the active view. what i'm thinking is that it's a call to see which view is active? anyway...

i hate having to turn off the same things, and turn them all on again, it's time consuming, and i know there's a way to do that. any help would be so much appreciated! farewell, and thanks for scanning your eyes across these letters of mine.

---

<div class="post-metadata">

### Author: ![m-koperwas](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@m-koperwas](https://forum.highend3d.com/u/m-koperwas)
#### Post date: [December 2, 1999, 10:37am UTC](https://forum.highend3d.com/t/viewport-commands/7920/2 "1999-12-02T10:37:09Z")

</div>

modelPanel#;

# being the window you're on.

open your script editor, echo all commands. right click in each window and read the script. the panel you're on is at the end of the list.

m.koperwas

---

<div class="post-metadata">

### Author: ![maryjane](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@maryjane](https://forum.highend3d.com/u/maryjane)
#### Post date: [December 3, 1999, 6:54am UTC](https://forum.highend3d.com/t/viewport-commands/7920/3 "1999-12-03T06:54:29Z")

</div>

thanks for the reply, i wasn't clear enough in the last post, sorry. what i mean is, i want to make a hotkey, that i push, and whichever view i'm in, i'll be able to show surf,curves,etc in that view.  
 i'm not a programmer, but i'm thinking there's a way to query, and assign a value to a view, then perform the command on whichever view it returns? is this right?  
 this is the last element of the interface that i haven't been able to customize to my liking, thanks for any help.

---

<div class="post-metadata">

### Author: ![koernel](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/k/9de0a6/32.png) [@koernel](https://forum.highend3d.com/u/koernel)
#### Post date: [December 10, 1999, 6:34am UTC](https://forum.highend3d.com/t/viewport-commands/7920/4 "1999-12-10T06:34:22Z")

</div>

Hi !

I had the same problem (look my toggle xray question), now I found a solution for the   
panel query problem. Look the online docs for "getPanel" command with flags either   
"-wf" for last focused panel or "-up" for panel under pointer.

string $panelQuery = `getPanel -wf``;

Never stop thinking, the Koernel !!!

---

<div class="post-metadata">

### Author: ![maryjane](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/9d8465/32.png) [@maryjane](https://forum.highend3d.com/u/maryjane)
#### Post date: [December 10, 1999, 3:20pm UTC](https://forum.highend3d.com/t/viewport-commands/7920/5 "1999-12-10T15:20:29Z")

</div>

thanks man, that's exactly what i needed. i found that command, but didn't know how to implement it so that i could put other commands to the result. thanks, you've helped a lot.

---

<div class="post-metadata">

### Author: ![m-koperwas](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@m-koperwas](https://forum.highend3d.com/u/m-koperwas)
#### Post date: [December 11, 1999, 3:30pm UTC](https://forum.highend3d.com/t/viewport-commands/7920/6 "1999-12-11T15:30:34Z")

</div>

you'll need to do a bit of scripting. just to leave which viewport you want open.

my advice (and what i did for myself): don't make it a button. make it a hotkey, or series of hotkeys.

wireframe on shaded for me is ctrl- (off ctrl-alt-)  
ghost mode ctrl-] (off ctrl-alt-])

get the idea? let me know if you have issues.

m.koperwas

---

<div class="post-metadata">

### Author: ![ewertb](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@ewertb](https://forum.highend3d.com/u/ewertb)
#### Post date: [December 14, 1999, 1:10am UTC](https://forum.highend3d.com/t/viewport-commands/7920/7 "1999-12-14T01:10:05Z")

</div>

Just by chance I recently posted a How-To about a very similar topic to this:

[  
How do I determine the name of the camera for the currently active layout panel?](http://www.cadvision.com/ewertb/maya/mel_a13.html)

I'll (soon) post an extension/addendum to this for toggling panel visibility settings.

--  
Bryan Ewert

--  
Bryan Ewert

---

<div class="post-metadata">

### Author: ![ewertb](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/e/7ab992/32.png) [@ewertb](https://forum.highend3d.com/u/ewertb)
#### Post date: [December 16, 1999, 5:35pm UTC](https://forum.highend3d.com/t/viewport-commands/7920/8 "1999-12-16T17:35:54Z")

</div>

Now available on-line:

[How do I get and set the](http://www.cadvision.com/ewertb/maya/mel_a14.html)
