string $stem = "dupes_"; string $suffix= "_GEO"; string $obj = "pPlane1"; //get a list of our objects, note that this is an array now string $dupeSel[] = `ls ($stem + "*" + $suffix)`; int $numbVerts[] = `polyEvaluate -v $obj`; int $i = 0; for($i; $i < $numbVerts[0]; $i++) { //pick an object to duplicate, by selecting a random int between 0 and the size of the array, Add one to bring it inline with our object IDs that start at 1 int $dupeInt = rand(0, size($dupeSel)); $dupeInt++; float $pos[] = `xform -q -ws -t ($obj + ".vtx["+$i+"]")`; //build up a string of which object to duplicate string $new[] = `duplicate -rr ($stem + $dupeInt + $suffix)`; setAttr ($new[0] + ".translateX") $pos[0]; setAttr ($new[0] + ".translateY") $pos[1]; setAttr ($new[0] + ".translateZ") $pos[2]; }