1 Reply Latest reply on Jan 28, 2016 3:21 AM by Yong Ning

    How to select  Suppression item, with SetSuppression2 command.

    Yong Ning

      Follow key code  is  swComponentSuppressed, swAllConfiguration, ConfArr

      code question , Result is ss2(0) = True,ss2(1) = True,ss2(2) = True,ss2(2) = True

       

      Hope result → ss2(0) = True,ss2(1) = false,ss2(2) = false,ss2(2) = false

       

       

      19.jpg

       

       

      Private Sub ll2()

          Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

              Set SwApp = Application.SldWorks

              Set SwModel = SwApp.ActiveDoc

          Dim SwSelMgr As SelectionMgr

              Set SwSelMgr = SwModel.SelectionManager

          Dim ConfArr, SwConf As Configuration

              ConfArr = SwModel.GetConfigurationNames

          Dim SwFeat As Feature

              Set SwFeat = SwSelMgr.GetSelectedObject5(1)

              ss = SwFeat.IsSuppressed2(swAllConfiguration, ConfArr)

          ss1 = Array(True, False, False, False)

              SwFeat.SetSuppression2 swComponentSuppressed, swAllConfiguration, ConfArr

              ss2 = SwFeat.IsSuppressed2(2, ConfArr)

              Stop

              Debug.Print SwFeat.Name

      End Sub

        • Re: How to select  Suppression item, with SetSuppression2 command.
          Yong Ning

          Private Sub ll()

             Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

                Set SwApp = Application.SldWorks

                Set SwModel = SwApp.ActiveDoc

             Dim SwSelMgr As SelectionMgr

                Set SwSelMgr = SwModel.SelectionManager

             Dim SwFeat As Feature, tmp

               

                tmp = SwModel.Extension.SelectByID2("TPattern1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)

              

                Set SwFeat = SwSelMgr.GetSelectedObject5(1)

                Debug.Print SwFeat.Name, SwFeat.GetTypeName

                SwFeat.SetSuppression2 swComponentSuppressed, swSpecifyConfiguration, "a2"

          End Sub