Dissolve Component Pattern VB

I am trying to dissolve patterns in the Feature Manager Design Tree through a vb program. I could not find an example in the api on how to do this.  I only found the dissolvecomponentpattern function.  I have the following code currently, but when I dissolve it deletes the assembly.

        swFeat = swModel.FirstFeature

        While Not swFeat Is Nothing

            Debug.Print(swFeat.Name)

            If swFeat.Name.Contains("Pattern") Then

                swFeat.Select(False)

                swModelDoc = swModel

                swModelDoc.DissolveComponentPattern()

            End If

            swSubFeat = swFeat.GetFirstSubFeature

            While Not swSubFeat Is Nothing

                Debug.Print("    " & swSubFeat.Name)

                swSubFeat = swSubFeat.GetNextSubFeature

            End While

            swFeat = swFeat.GetNextFeature

        End While

    End Sub

SolidworksApi macros