9 Replies Latest reply on Oct 13, 2017 10:05 AM by Deepak Gupta

    automatically change the configuration of a part in a drawing view to the next configuration in the design tree

    Charles Leonard

      Hi I'm trying to make a macro that will automatically change the configuration of a part in a drawing view to the next configuration in the design tree.

       

       

      confName = vConfs(i)

              Dim y As Integer

      Dim Modelsw                     As SldWorks.ModelDoc2

      Set Modelsw = swApp.ActiveDoc

      Set swDraw = Modelsw

          Dim vSheets As Variant

          vSheets = swDraw.GetViews

          ConfigNames = ModelDoc2.GetConfigurationNames()

           numConfigs = ModelDoc2.GetConfigurationCount()    

        For v = 0 To (numConfigs - 1)                    

       

          For y = 0 To UBound(vSheets)

             

              Dim j As Integer

              Dim vViews As Variant

             

              vViews = vSheets(y)

             

              For j = 0 To UBound(vViews)

                 

                  Set swView = vViews(j)

                  swView.ReferencedConfiguration = confName

              Next

             

          Next

              swModel.ForceRebuild3 False

       

       

      This is as far as I've gotten.

       

       

      Can anyone give me some guidance?