6 Replies Latest reply on Oct 21, 2016 8:22 AM by Solidworks Selim

    I need a macro to delete supressed featrues

    zaher taleb

      Hi,

      can anyone help me?

      I need a macro to delete supressed featrues in Part file!!

      Regards

      Zaher

        • Re: I need a macro to delete supressed featrues
          Wesley Prins

                  Dim swApp As SldWorks

                  Dim Part As ModelDoc2

                  Dim features As Object

           

                  swApp = GetObject(, "sldworks.application")

                  Part = swApp.ActiveDoc

           

                  features = Part.FeatureManager.GetFeatures(False)

                  Dim ftname As String = ""

           

                  For Each fts In features

                      ftname = fts.Name

                      If fts.IsSuppressed = True Then

                          Part.SelectByID(fts.Name, "BODYFEATURE", 0, 0, 0)

                          Part.Extension.DeleteSelection2(0)

                      End If

                  Next