MoI discussion forum
MoI discussion forum

Full Version: Auto Number Object Copys

Show messages:  1-2  3-22  23

From: Mindset (IGNITER)
28 Oct   [#23] In reply to [#22]
Terrificâť—
I left-padded the number with zeros to 2 digits Took me hours

script: /*!Obj-Name + Number */ var numb = 0 ; var Objects = moi.geometryDatabase.getObjects(); Objects.sortBySelectionOrder(); var Names = new Object(); for ( var i = 0; i < Objects.length; ++i ) { var Obj = Objects.item(i); if ( Obj.name == '' ) { continue; } if ( !Names[Obj.name] ) { Names[Obj.name] = new Array(); } Names[Obj.name].push( Obj ); } for ( var Name in Names ) { if ( Names[Name].length == 1 ) { continue; } for ( var i = 0; i < Names[Name].length; ++i ) { numb = (i+1); numb = numb.toString();while (numb.length < 2) numb = "0" + numb; Names[Name][i].name = Name + '_' + numb; } }


Moi Bueno
MindSet

Show messages:  1-2  3-22  23