View Single Post
# 2 14-01-2009 , 11:43 PM
bendingiscool's Avatar
Subscriber
Join Date: Jul 2006
Location: London
Posts: 567
I tried some suggestions, made a couple of changes to sort out syntax, now it says its ok as is doesn't give any errors, but for some reason its not printing out anything, no matter where the cylinder is.

Code:
$boolPrinted = 0;

float $cylBBox[] = `xform -q -ws -boundingBox pCylinder1`;// cylinder's BBox
float $grpBBox[] = `xform -q -ws -boundingBox group1`;// group's BBox

if (     ($cylBBox[0] < $grpBBox[0]) && ($cylBBox[3] > $grpBBox[3]) ||//check X BBox
        ($cylBBox[2] < $grpBBox[2]) && ($cylBBox[5] > $grpBBox[5]) )//check Z BBox
{
    if ($boolPrinted == 0)
    {
print "Object is in";
$boolPrinted = 1;
    }
}
    else
    {
    if ($boolPrinted == 1)
    {
print "Object is out";
$boolPrinted = 0;
    }

}
The bouding box numbers should be ok but for some reason it isn't printing the words.

Any ideas on this one?

Thanks, Chris