string $objs[] = `ls -sl`;
string $temp_objs[]={};
string $temp_obj = `match "^[^\.]*" $objs[0]`;
duplicate -n tempmesh $temp_obj;
for ($i=0;$i<size($objs);$i++) {
string $temp_comp = `match "\\..*" $objs[$i]`;
$temp_objs[$i] = "tempmesh"+$temp_comp;
}
polyChipOff -ch 0 -kft 1 -dup 0 -off 0 $temp_objs;
polySeparate -ch 0 tempmesh;
$total = size($objs);
select `ls -sl -tl $total`;
float $area[] = `polyEvaluate -a`;
if($area[0]!=0) {
delete tempmesh;
}
print("Area: "+$area[0]);
select $objs;