# Querying the model panel...?

**URL:** https://forum.highend3d.com/t/querying-the-model-panel/5439
**Category:** Maya
**Tags:** mel
**Created:** [March 22, 2003, 3:41am UTC](https://forum.highend3d.com/t/querying-the-model-panel/5439 "2003-03-22T03:41:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pinxue](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/p/a88e4f/32.png) [@pinxue](https://forum.highend3d.com/u/pinxue)
#### Post date: [March 22, 2003, 3:41am UTC](https://forum.highend3d.com/t/querying-the-model-panel/5439/1 "2003-03-22T03:41:02Z")

</div>

Hey all, I want to write a mel script that will just turn off and on xray shaded mode in whatever view I am in. It works fine for turining it on and off but How do I query the name of the window. I looked in the script editor and when I turned on xray mode it had a name like modelView4 in its last field, So how do I return the modelView I am currently in. Thanks for any help....

---

<div class="post-metadata">

### Author: ![takigawa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/t/90db22/32.png) [@takigawa](https://forum.highend3d.com/u/takigawa)
#### Post date: [March 22, 2003, 7:36am UTC](https://forum.highend3d.com/t/querying-the-model-panel/5439/2 "2003-03-22T07:36:18Z")

</div>

"-wf" flag of "getPanel" command will show you the panel that currently has focus.

In case with me, I usually use it as follows...  
{  
string $curPanel = `getPanel -wf`;  
if(`modelEditor -q -xray $curPanel`)modelEditor -e -xray 0 $curPanel;  
else modelEditor -e -xray 1 $curPanel;  
}

\*Maya 4.5 NT ~takigawa

---

<div class="post-metadata">

### Author: ![zadrel](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/z/839c29/32.png) [@zadrel](https://forum.highend3d.com/u/zadrel)
#### Post date: [May 15, 2019, 9:47pm UTC](https://forum.highend3d.com/t/querying-the-model-panel/5439/3 "2019-05-15T21:47:46Z")

</div>

Hey,

How do you query the model of a window that does not have focus?
