2 Replies Latest reply on Aug 20, 2015 7:29 AM by Hrituc Alexandru

    Drawing Views Selection

    Hrituc Alexandru

      Hi,

      How can write a code to select from design tree all drawing views from active sheet?

      Thanks,

      1.jpg

        • Re: Drawing Views Selection
          Deepak Gupta

          Option Explicit

              Dim swApp                   As SldWorks.SldWorks

              Dim swModel                 As SldWorks.ModelDoc2

              Dim swDraw                  As SldWorks.DrawingDoc

              Dim swView                  As SldWorks.View

              Sub main()

             

              Set swApp = Application.SldWorks

              Set swModel = swApp.ActiveDoc

              Set swDraw = swModel

              Set swView = swDraw.GetFirstView

             

              While Not swView Is Nothing

                  swDraw.Extension.SelectByID2 swView.GetName2, "DRAWINGVIEW", 0, 0, 0, True, 0, Nothing, 0

                  Set swView = swView.GetNextView

              Wend

           

           

          End Sub