How to loop through Sketch Driven Pattern Solid Bodies and select them? Macros API

Hello,

After creating multiple bodies through Sketch Driven Pattern tool, I am trying to select them in order to use the Combine tool. My array of driven bodies looks like this:

Each time that I will run the macros, I will have different amount of patterned bodies, so I need to keep while loop as open-ended and check (for example) if Sketch-Pattern1[10] exists or not, and then select all of the bodies (or one by one through the loop). 

This is how I manage to select one of the bodies:

boolstatus = swModelDoc.Extension.SelectByID2("Sketch-Pattern1[1]", "SOLIDBODY", 0, 0, 0, True, 256, Nothing, 0)

I will appreciate any help,

Sincerely,
Gilad

SolidworksApi/macros