insert Bobies into new part via API

Hello,

can someone point me on the right direction to export some bodies from a multibody part into a new part using api?

i want to mimic the behaviour os the existing command "Inser into new part", but need some tweeks as automatic file name, custom properties, etc...

thanks in advance,

Bruno.

SolidworksApi/macros