3 Replies Latest reply on Nov 21, 2016 7:17 PM by Ryan Tegantvoort

    Flat pattern corner treatment.

    Evan Dlugopolski

      Hello all,

       

      Does anyone know of a way to pragmatically un-check this box under the flat-pattern feature of a sheet metal part?

       

      Thanks,

      Evan

        • Re: Flat pattern corner treatment.
          Deepak Gupta

          Yes, check for CornerTreatment in API help.

          • Re: Flat pattern corner treatment.
            John Christensen

            '----------------------------------------------------------------------------
            ' Preconditions: Sheet metal part is open.
            '
            ' Postconditions: Corner treatment unchecked
            '----------------------------------------------------------------------------
            Dim swApp                       As SldWorks.SldWorks
            Dim swModel                     As SldWorks.ModelDoc2
            Dim swSelMgr                    As SldWorks.SelectionMgr
            Dim swFeat                      As SldWorks.Feature
            Dim swSubFeat                   As SldWorks.Feature
            Dim bRet                        As Boolean

            Option Explicit

            Sub Process_FlatPattern _
            ( _
                swApp As SldWorks.SldWorks, _
                swModel As SldWorks.ModelDoc2, _
                swFeat As SldWorks.Feature _
            )

                Debug.Print "  +" & swFeat.Name & " [" & swFeat.GetTypeName & "]"

                Dim swFlatPatt     As SldWorks.FlatPatternFeatureData
                Set swFlatPatt = swFeat.GetDefinition
                Dim boolstatus As Boolean
                   
                'force CornerTreatment to false
                swFlatPatt.CornerTreatment = False
                boolstatus = swFeat.ModifyDefinition(swFlatPatt, swModel, Nothing)

                Debug.Print "      Corner Treatment? " & swFlatPatt.CornerTreatment
            End Sub

            Sub main()

                Set swApp = Application.SldWorks
                Set swModel = swApp.ActiveDoc
                Set swSelMgr = swModel.SelectionManager
                Set swFeat = swModel.FirstFeature
                
                Debug.Print "File = " & swModel.GetPathName
                Do While Not swFeat Is Nothing
                    Select Case swFeat.GetTypeName
                        Case "FlatPattern"
                            Process_FlatPattern swApp, swModel, swFeat
                    End Select
                    Set swSubFeat = swFeat.GetFirstSubFeature
                    Set swFeat = swFeat.GetNextFeature
                Loop
            End Sub