0 Replies Latest reply on Oct 14, 2014 2:27 AM by Pranjal Jamsandekar

    How to create corner trim after using the create 3 point arc method?

    Pranjal Jamsandekar

      Could anybody help me about how should I trim this line.Also I am attaching the code for the same.

       

      Dim swApp As SldWorks.SldWorks
      Dim swModel As SldWorks.ModelDoc2
      Dim swSketchMgr As SldWorks.SketchManager
      Dim swSketchSeg As SldWorks.SketchSegment
      Dim swLine(3) As SldWorks.SketchLine

      Sub main()
          Set swApp = Application.SldWorks
          Set swModel = swApp.ActiveDoc
          Set swSketchMgr = swModel.SketchManager
         
          'create plane and insert sketch
          swModel.Extension.SelectByID2 "TOP PLANE", "PLANE", 0, 0, 0, False, 0, Nothing, 0
          swSketchMgr.InsertSketch True
         
          'turn on direct addition to database
          swSketchMgr.AddToDB = True
         
          'create sketch profile
          Set swLine(0) = swSketchMgr.CreateLine(0.025, 0.05, 0, 0.025, -0.05, 0)
          Set swLine(1) = swSketchMgr.CreateLine(0.025, -0.05, 0, -0.025, -0.05, 0)
          Set swLine(2) = swSketchMgr.CreateLine(-0.025, -0.05, 0, -0.025, 0.05, 0)
          Set swLine(3) = swSketchMgr.CreateLine(-0.025, 0.05, 0, 0.025, 0.05, 0)
         
          'create arc
          Set swSketchSeg = swLine(2)
          swSketchSeg.Select False
         
          Set swSketchSeg = swLine(0)
          swSketchSeg.Select True
         
          Set swSketchSeg = swSketchMgr.Create3PointArc(-0.025, 0.03, 0, 0.025, 0.03, 0, 0, 0.05, 0)
         
          'create corner sketch trim
         
          Set swSketchSeg = swLine(2)
          swSketchSeg.Select True
         
          swModel.SketchManager.SketchTrim 0, -0.025, 0.03, 0
         
         
          'turn off direct addition to database
          swSketchMgr.AddToDB = False
         
      End Sub