3 Replies Latest reply on Nov 10, 2014 3:40 AM by Feroz Mahomed

    Offset surface zero

    Feroz Mahomed

      I recorded a macro to offset selected surfaces zero mm. However, nothing happens when I run the recorded macro.

      What do I need to change in the macro so that it works.

      I think all the code in red needs to be deleted.

       

      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("", "FACE", 8.91975511900966E-03, 3.19971046571936E-02, -4.81589045909914E-03, False, 0, Nothing, 0)
      Part.SelectTangency
      Part.ClearSelection2 True
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, False, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      boolstatus = Part.Extension.SelectByID2("", "FACE", 0, 0, 0, True, 1, Nothing, 0)
      End Sub