1 Reply Latest reply on Nov 27, 2016 8:06 AM by Peter Brinkhuis

    BreakLineSmallZigZagCut

    Yong Ning

      Sub main()

      Set swApp = Application.SldWorks

      Set Part = swApp.ActiveDoc

      Set SelMgr = Part.SelectionManager

      swApp.ActiveDoc.ActiveView.FrameState = 1

      boolstatus = Part.Extension.SelectByID2("Break Line6", "BREAKLINE", 0.1286567303037, 0.2191061526578, 0, False, 0, Nothing, 0)

      boolstatus = Part.Extension.SelectByID2("Break Line6", "BREAKLINE", 0.1293775418842, 0.2191061526578, 0, False, 0, Nothing, 0)

      Part.BreakLineSmallZigZagCut

      End Sub

       

      result is error

       

       

      0.jpg

        • Re: BreakLineSmallZigZagCut
          Peter Brinkhuis

          Error 438 apparently is "error 438 "object doesn't support this property or method". Which means you're trying to do something to an object that doesn't support that. What should the macro do? You have obviously used the macro recorder to create this code. What steps did you follow to create the macro? What was selected before recording, that sort of thing.

           

          BreakLineZigZagCut is an old and superseded method to set the style of the break line in a drawing. The current method is to use the style property, as can be found in the help files below.

          2015 SOLIDWORKS API Help - BreakLineZigZagCut Method (IDrawingDoc)

          2015 SOLIDWORKS API Help - Style Property (IBreakLine)

           

          I would start by defining swApp as sldworks.sldworks and part as sldworks.drawingDoc. Instead of a an object, you now define what kind f object it should be. The BreakLineZigZagCut method needs a drawing document and so does the style property.