AnsweredAssumed Answered

InsertCenterLine2 command operation is not stable?

Question asked by Yong Ning on Nov 15, 2015

5.jpg

 

SwDraw.InsertCenterLine2

 

 

Private Sub ll1()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

      Set SwApp = Application.SldWorks

      Set SwModel = SwApp.ActiveDoc

   Dim SwDraw As DrawingDoc

      Set SwDraw = SwModel

   Dim SheetArr, tmp

      SheetArr = SwDraw.GetSheetNames

   Dim SwView As View

    

      For ii = 0 To UBound(SheetArr)

          SwDraw.ActivateSheet SheetArr(ii)

          SwModel.ViewZoomtofit

          Set SwView = SwDraw.GetFirstView

          Do While Not SwView Is Nothing

             tmp = SwModel.Extension.SelectByID2(SwView.GetName2, "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

             SwDraw.InsertCenterLine2

       

             Set SwView = SwView.GetNextView

          Loop

          'Stop

      Next ii

    

    

End Sub

Outcomes