I’m new to the Sketchup scene and have reached out to Justin Geis at TheSketchupEssentials.com at which point he suggested I post my question to this forum.
I have a component that I am duplicating and trying to rename each individual instance.
The first 10 components are positioned relative to each other and that relationship is constant.
They are numbered in order 0001 through 0010 by their distance from the ground (x,y plane) where 0001 is the highest (furthest from the ground) to 0010 which is the lowest (closest to the ground).
However, I am duplicating that same group of 10 a total of 136 times across the structure so I actually will have 1,360 components in the model.
Let’s say for the sake of argument that I want to label each instance from 0001 through 1360 going from top to bottom within each group of 10.
For example, the top component in the 3rd group of 10 would be ‘0021’ and the bottom would be ‘0030’ continuing until the last group of 10 (the 136th group) being labeled from top to bottom as ‘1351’ to ‘1360’ respectively.
I am using Ruby to rename the instances through scripting and the reason I’m posting is the following :
I label the original 10 manually ‘0001’ through ‘0010’, then I do a move with the Ctrl key to leave a copy and place the second group of 10, then multiply to create the rest. Each component now has an instance of ‘0001’ through ‘0010’ repeated 136 times. I want to name the unique instances from 0001 to 1360.
When I traverse this array in Ruby, element through element are correctly labeled,
HOWEVER, element through , when the instance name is checked, appear to be random.
Element has an instance name of ‘0007’, through  are 0002,0004,0008,0001,0005,0010,0009,0001 and 0003 respectively.
Elements  through  have a different randomization (ex. 6,5,9,3,1,8,4,10,2,7) and so on.
MY QUESTION IS THIS :
Is there a way to label each instance in the correct ascending order from ‘0001’ to ‘1360’ where, when traversed,
they reference from top to bottom in each group of 10 then move to the next group of 10, and so on.
Any help would be appreciated.
Craig (A Sketchup/Ruby novice)