Making a repetition function in my macro

Hi,

I want to make macro to build lots cellular structure with difference dimension. For example this one :

Therefor, to achieve this structure, I must use the repetition function of the initial bars and the basic elementary cellular structure.

Does anyone have an idea which procedure/method I should use to select the elements when I want to apply the elements to be repeated,such as selectbyID2, etc.. Knowing that the dimensions will change for each different sizes.

SolidworksApi macros