auto naming function

 From:  Michael Gibson
5701.5 In reply to 5701.4 
Hi Nos, here is a script for the first one, this one will strip off the last 2 upper case letters from the names of the selected objects:

script: /* Strip last 2 upper case letters from the names of the selected objects */ var objs = moi.geometryDatabase.getSelectedObjects(); function isupper(str,i) { var code = str.charCodeAt(i); return code >= 65 && code <= 90; } for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); var name = obj.name; if ( isupper(name,name.length-2) && isupper(name,name.length-1) ) obj.name = name.substr(0,name.length-2); }

- Michael