1 Reply Latest reply on Aug 10, 2015 3:59 AM by Aleksandr Hohlatsov

    Traverse Configuration → EditUnsuppress

    Yong Ning

      0.jpg

       

      Traverse Configuration

      vSheets = SwModel.GetConfigurationNames

       

      Question,

      Traverse Configuration → select Feature →  EditUnsuppress

       

      Hope other methor ?

       

       

       

       

       

      Private Sub ll1()

         Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

            Set SwApp = Application.SldWorks

            Set SwModel = SwApp.ActiveDoc

         Dim vSheets, SwConf As Configuration

            vSheets = SwModel.GetConfigurationNames

           

         Dim SwFeat As Feature, SwSubFeat As Feature

         For ii = 0 To UBound(vSheets)

            'Set SwConf = SwModel.GetConfigurationByName(vSheets(ii))

            SwModel.ShowConfiguration2 vSheets(ii)

            Set SwFeat = SwModel.FirstFeature

            Do While Not SwFeat Is Nothing

               If SwFeat.GetTypeName = "MateGroup" Then

                   Set SwSubFeat = SwFeat.GetFirstSubFeature

                   'Debug.Print SwFeat.Name, SwFeat.GetTypeName,

                   Do While Not SwSubFeat Is Nothing

                      With SwSubFeat

                         Debug.Print .Name, .GetTypeName

                         .Select True

                      End With

                     

                      Set SwSubFeat = SwSubFeat.GetNextSubFeature

                      'Stop

                   Loop

                   SwModel.EditUnsuppress

                   'Stop

               End If

               Set SwFeat = SwFeat.GetNextFeature

            Loop

         Next ii

      End Sub