How to delete existing structural member group in solidworks API

I am trying to automate weldment part, so user can add multiple instances in sketch pattern. When I change number of instances in sketch patter it only add sketch (image 2). Then I manually add sketch in the group, then it work fine. I want to automate this by in API. I tried using recording macro too.

Anybody have idea about how to delete existing structural member group or update existing sketches in the group in solidworks API (image 1) ?

Thanks in advance.

SolidworksApi macros