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[0] through element[9] are correctly labeled,
HOWEVER, element[10] through [19], when the instance name is checked, appear to be random.
Element[10] has an instance name of β0007β,[11] through [19] are 0002,0004,0008,0001,0005,0010,0009,0001 and 0003 respectively.
Elements [20] through [29] 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.
Thanks,
Craig (A Sketchup/Ruby novice)