Hi there, and nice work on your randomizer! I will say this - I couldn't track down the error in your code but I believe it may have something to do with you calling your array items using 1-based numbering instead of 0-based numbering. In any event, your code is a bit verbose. I've written a smaller version without the bells and whistles that does the same thing. Give this a try:
global proc randomizeIt()
{
string $objs[] = ls -sl;
$ui = "rUI|main|";
for ($chan in {"translate","rotate","scale"}){
for ($xyz in {"X","Y","Z"}){
float $min = floatField -q -v ($ui+"min"+$chan+$xyz);
float $max = floatField -q -v ($ui+"max"+$chan+$xyz);
for ($obj in $objs){
$rand = rand($min, $max);
float $check = checkBox -q -v ($ui+"check"+$chan+$xyz);
if ($check==1) setAttr ($obj+"."+$chan+$xyz) $rand;
}
}
}
}
global proc buildUI(){
float $value[] = {0,0,1};
int $i=0;
if (window -ex "rUI") deleteUI "rUI";
window -wh 188 206 -t "RandomizerUI" rUI;
rowColumnLayout -nc 4 "main";
for ($chan in {"translate","rotate","scale"}){
for ($xyz in {"X","Y","Z"}){
text -l ($chan+$xyz);
checkBox -l "" -cc "randomizeIt" ("check"+$chan+$xyz);
floatField -cc "randomizeIt" -v $value[$i] ("min"+$chan+$xyz);
floatField -cc "randomizeIt" -v $value[$i] ("max"+$chan+$xyz);
}
$i++;
}
button -l "OK" -c ("randomizeIt");
setParent..;
showWindow;
}