AnsweredAssumed Answered

Changing sheet metal flat-pattern 'Merge faces' setting is not working.

Question asked by Daniel Martin on Feb 17, 2020
Latest reply on Feb 17, 2020 by Daniel Martin

I am trying to turn the 'merge faces' option on in a part using the api but it does not show changes in the part. Running the macro I have written below (I have isolated only the relevant part of the code) I can see the setting starts 'off', I then switch it 'on' in the code and the debug.print confirms this, however the actual part in solidworks remains with the setting switched off. What am I doing wrong? or is this the same for everyone?


Sub main2()
Dim swApp As SldWorks.SldWorks
Dim swFeat As SldWorks.Feature
Dim swModel As ModelDoc2
Dim swFlatPatt As SldWorks.FlatPatternFeatureData

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeature

Do While Not swFeat Is Nothing
Select Case swFeat.GetTypeName
Case "FlatPattern"
Set swFlatPatt = swFeat.GetDefinition
Debug.Print swFeat.Name & " Merged Faces? " & swFlatPatt.MergeFace
swFlatPatt.MergeFace = True
Debug.Print swFeat.Name & " Merged Faces? " & swFlatPatt.MergeFace
End Select
Set swFeat = swFeat.GetNextFeature
End Sub