Show messages:
1-20
21-23
From: Mindset (IGNITER)
Hello Micheal, et. al.
Might there be some modification that would respect the 'order of selection' when using the "object name separator" script?
http://moi3d.com/forum/index.php?webtag=MOI&msg=3114.5
Thanks!
Moi Bueno
MindSet
From: Michael Gibson
Hi MindSet,
re:
> Might there be some modification that would respect the 'order of selection' when using the "object name separator" script?
Try this one:
script: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 ) { Names[Name][i].name = Name + '_' + (i+1); } }
- Michael
From: Mindset (IGNITER)
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-20
21-23