Assign SelectedObjects into array

Hello!

I have a trouble with assigning arrays. Case is:

    

     I have Selection which I've got from SelectionBox.

     I'm able to access to the selection with SelectionMgr.GetSelectedObjects6.

     I need to assign the whole selection into an array of objects so I can store them in MacroFeatureData.SetSelection.

     I tried redim array, loop through the Selection and assign each part of the array to the SelectionMgr.GetSelectedObjects6(i, -1), i - is a counter of the loop.

     Unfortunatelly, It didn't work. Collections are useless in this case too.

     Have somebody found the solution of the problem?

Thank you for any information you could provide me with!

Best regards.

SolidworksApi macros