View Single Post
Old 16-01-2004, 01:36 PM   #2
equinox
Registered User
 
equinox's Avatar
 
Join Date: Apr 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

You used ( ' ), You must use ( ` ) . Examples


1.

if( `checkBox -q -v cb_front` )
polyPlane -w 1 -h 1 -sx 1 -sy 1 -ax 0 1 0 -tx 1 -ch 1;

2.

string $sn[]=`ls -sl -dag -type mesh`;

3.

float $size = `getAttr polyCube1.width`;
print $size;






Try this


int $panelVis;
{
// get active panel
string $currentPanel = `getPanel -underPointer`;

// no panel under pointer --> get panel with focus
if ($currentPanel == "")
$currentPanel = `getPanel -withFocus`;

// get panel display type
string $panelType = `getPanel -typeOf $currentPanel`;

// get panel name
string $currentName = `modelPanel -query -label $currentPanel`;

if ($panelType == "modelPanel")
{
// Toggle grid in correct panel:
if($currentName == "Top View")
{$panelVis = `modelEditor -q -grid modelPanel1`;
if ($panelVis == "0")
modelEditor -e -grid 1 modelPanel1;
if ($panelVis == "1")
modelEditor -e -grid 0 modelPanel1;
}

if($currentName == "Side View")
{$panelVis = `modelEditor -q -grid modelPanel2`;
if ($panelVis == "0")
modelEditor -e -grid 1 modelPanel2;
if ($panelVis == "1")
modelEditor -e -grid 0 modelPanel2;
}

if($currentName == "Front View")
{
$panelVis = `modelEditor -q -grid modelPanel3`;
if ($panelVis == "0")
modelEditor -e -grid 1 modelPanel3;
if ($panelVis == "1")
modelEditor -e -grid 0 modelPanel3;
}

if($currentName == "Persp View")
{$panelVis = `modelEditor -q -grid modelPanel4`;
if ($panelVis == "0")
modelEditor -e -grid 1 modelPanel4;
if ($panelVis == "1")
modelEditor -e -grid 0 modelPanel4;
}
}
}
equinox is offline   Reply With Quote