Checking option MergeFace doesn't work on flat pattern feature

Hello eveybody,

I have a metal sheet part, I test if the the option MergeFace is checked, if not I try to chek it but it doesn't work, I dont know why ?

Here is my code :

<p>Sub Main()</p><p></p><p>        Dim swApp As SldWorks</p><p>        Dim swDoc As ModelDoc2</p><p>        Dim swFlatPatt As FlatPatternFeatureData</p><p></p><p>        Try</p><p></p><p>            swApp = CreateObject("SldWorks.Application")</p><p>            swDoc = swApp.ActiveDoc</p><p></p><p>            Dim swSelectedFeature As Feature = GetFeatureByName("Etat déplié1", swDoc)</p><p></p><p>            swFlatPatt = swSelectedFeature.GetDefinition()</p><p></p><p>            If Not swFlatPatt.MergeFace Then swFlatPatt.MergeFace = True</p><p></p><p>        Catch ex As Exception</p><p>            Debug.Print(ex.Message)</p><p>        End Try</p><p></p><p>        Console.Read()</p><p></p><p>    End Sub</p><p></p><p>    Function GetFeatureByName(ByVal _Name As String, swDoc As ModelDoc2) As Feature</p><p></p><p>        Try</p><p></p><p>            For i As Integer = 0 To swDoc.GetFeatureCount - 5</p><p>                Dim swFeature As Feature = swDoc.FeatureByPositionReverse(i)</p><p>                If swFeature.Name.ToUpper = _Name.ToUpper Then</p><p>                    Return swFeature</p><p>                End If</p><p>                Dim swSubFeature As Feature = swFeature.GetFirstSubFeature()</p><p>                If swSubFeature Is Nothing Then Continue For</p><p>                Do</p><p>                    If swSubFeature.Name.ToUpper = _Name.ToUpper Then</p><p>                        Return swSubFeature</p><p>                    End If</p><p>                    swSubFeature = swSubFeature.GetNextSubFeature</p><p>                Loop Until swSubFeature Is Nothing</p><p></p><p>            Next</p><p></p><p>            Return Nothing</p><p></p><p>        Catch ex As Exception</p><p>            Throw ex</p><p>        End Try</p><p></p><p>    End Function</p>

Thanks in advance.

SolidworksApi macros