global proc GeoConstrain() { //select Geometry then joints //parse selection list string $jlist[] = `ls-sl`; //store size of the list int $jlistsz = size($jlist); //initialize counter variable int $count = 1; //select Geometry which should be the first element in the list select -r $jlist[0]; //repeat for the number of elements in jlist //select joint then geo constrain to selection for ($count = 1; $count < $jlistsz; $count++) { geometryConstraint -weight 1 $jlist[0] $jlist[$count]; } select -cl; }