# Mel to change active panel?

**URL:** https://forum.highend3d.com/t/mel-to-change-active-panel/4995
**Category:** Maya
**Tags:** mel
**Created:** [August 25, 2003, 8:43pm UTC](https://forum.highend3d.com/t/mel-to-change-active-panel/4995 "2003-08-25T20:43:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [August 25, 2003, 8:43pm UTC](https://forum.highend3d.com/t/mel-to-change-active-panel/4995/1 "2003-08-25T20:43:19Z")

</div>

One of those things that seemed simple, then stumped me.

Obviously, you can RMB in a panel, and it becomes the "active panel". Any thoughts on how to do his in mel? I know that Maya's 4 main modelPanels are called:  
modelPanel1  
modelPanel2  
modelPanel3  
modelPanel4

and their parent is "viewPanes".

I've also dug up this command:  
paneLayout -e -api 1 viewPanes;

This seems to "kind of" highlight the provided pane (in this case, modelPane1), but it still dosen't make it the "active panel". The pannel is highlighted, but it's a 1 pixel thick highlight, not the same as clicking in the window.

Any thoughts?

---

<div class="post-metadata">

### Author: ![gdc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gdc](https://forum.highend3d.com/u/gdc)
#### Post date: [August 25, 2003, 9:04pm UTC](https://forum.highend3d.com/t/mel-to-change-active-panel/4995/2 "2003-08-25T21:04:49Z")

</div>

I think the setFocus command is what your looking for.

// set the active window to be the "top" view  
setFocus modelPanel1 ;

--g

---

<div class="post-metadata">

### Author: ![warpcat](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/w/c89c15/32.png) [@warpcat](https://forum.highend3d.com/u/warpcat)
#### Post date: [August 25, 2003, 9:06pm UTC](https://forum.highend3d.com/t/mel-to-change-active-panel/4995/3 "2003-08-25T21:06:51Z")

</div>

I,... I love you... ![](http://64.32.63.100/forums/icons/wink.gif) Ok, just kidding, but I'm sure you're a nice person....

Thanks man, I knew it would be that easy. Just couldn't find the friggin command!
