How to set array of bodies to bodiestocombine property of combine feature?

Hi all,

I am trying to edit combine bodies feature through APIs. How can I assign the bodies to bodiestocombine property?

I tried assigning an array of bodies together  like:

swCombine.BodiesToCombine = bodies

  where bodies = part.GetBodies2(swcnst.swBodyType_e.swSolidBody, False)

I also tried assigning one by one like:

  Dim body As SldWorks.Body2

For i As Integer = 0 To bodies.Length - 1

                                       body = bodies(i)

                                      swCombine.BodiesToCombine = body

   Next

Please support with your advices..

Best Regards

SolidworksApi macros