1 Reply Latest reply on Jun 11, 2014 9:22 PM by Josh Brady

    sketch on top plane

    Vishaldeep Singh

      hello

      i want to make a sketch at top plane

      As per coding sketch must start at point 0.5mm but it is not working so

      by default it is starting at 0. output i want is as shown in image

      Dim swApp As Object

       

       

      Dim Part As Object

      Dim boolstatus As Boolean

      Dim longstatus As Long, longwarnings As Long

       

       

      Sub main()

       

       

      Set swApp = _

      Application.SldWorks

       

       

      Set Part = swApp.ActiveDoc

      boolstatus = Part.Extension.SelectByID2("Top", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

      Part.SketchManager.InsertSketch True

      Part.ClearSelection2 True

      Dim skSegment As Object

      Set skSegment = Part.SketchManager.CreateLine(0.0005, 0.00525, 0#, 0.0132, 0.00525, 0#)

      Set skSegment = Part.SketchManager.CreateLine(0.0132, 0.00525, 0#, 0.0132, -0.06475, 0#)

      Set skSegment = Part.SketchManager.CreateLine(0.0132, -0.06475, 0#, 0.0005, -0.06475, 0#)

      Set skSegment = Part.SketchManager.CreateLine(0.0005, -0.06475, 0#, 0.0005, 0.00525, 0#)

      Part.ClearSelection2 True

      Part.SketchManager.InsertSketch True

      End Sub