global proc gen_random_planes(int $num, float $minx, float $maxx,
                                        float $miny, float $maxy,
                                        float $minz, float $maxz) {
int $n;                                
for($n = 0; $n < $num; $n++) {
    $x = rand($minx, $maxx);
    $y = rand($miny, $maxy);
    $z = rand($minz, $maxz);
    
    nurbsPlane -p $x $y $z -ax (rand(0.0, 1.0)) 
                                (rand(0.0, 1.0))
                                (rand(0.0, 1.0)) ;
    }
select "nurbs*";
string $planes[] = `ls -sl`;
group $planes;
}