AnsweredAssumed Answered

After running the below code I am not getting the "CreateTangentArc" in the sketch

Question asked by Pranjal Jamsandekar on Oct 4, 2014
Latest reply on Oct 4, 2014 by Pranjal Jamsandekar

Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSketchMgr As SldWorks.SketchManager
Dim swFeatMgr As SldWorks.FeatureManager

Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swSketchMgr = swModel.SketchManager
    Set swFeatMgr = swModel.FeatureManager
      
    'select the front 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 entity
    swSketchMgr.CreateLine 0.2605, 0.0555, 0, 0.2605, -0.0555, 0
    swSketchMgr.CreateLine 0.2605, -0.0555, 0, -0.2605, -0.0555, 0
    swSketchMgr.CreateLine -0.2605, -0.0555, 0, -0.2605, 0.0555, 0
    swSketchMgr.CreateLine -0.2605, 0.0555, 0, 0.2605, 0.0555, 0
     
   
    'fully define sketch
    swModel.Extension.SelectByID2 "", "EXTSKETCHPOINT", 0, 0, 0, False, 6, Nothing, 0
    swSketchMgr.FullyDefineSketch True, True, 1023, True, 1, Nothing, 1, Nothing, 0, 0
   
    'create base extrusion
    swFeatMgr.FeatureExtrusion2 True, False, True, 0, 0, 0.0488, 0, False, False, False, False, 0, 0, False, _
                          False, False, False, True, True, True, 0, 0, False
                         
                         
    swModel.ShowNamedView2 "", 7
    swModel.ViewZoomtofit2
   
   
    'create extrude cut profile
    swModel.Extension.SelectByID2 "TOP PLANE", "PLANE", 0, 0, 0, False, 0, Nothing, 0
    swSketchMgr.InsertSketch True

    swSketchMgr.CreateLine 0.2525, 0.014, 0, 0.2475, 0.019, 0
    swSketchMgr.CreateLine 0.2475, 0.019, 0, 0.2325, 0.019, 0
    swSketchMgr.CreateTangentArc 0.2325, 0.019, 0, 0.227, 0.0245, 0, 1
    swSketchMgr.CreateLine 0.227, 0.0245, 0, 0.227, 0.0425, 0
    swSketchMgr.CreateLine 0.227, 0.0425, 0, 0.222, 0.0475, 0
    swSketchMgr.CreateLine 0.222, 0.0475, 0, 0.176, 0.0475, 0
       
    swSketchMgr.CreateLine 0.176, 0.0475, 0, 0.171, 0.0425, 0
    swSketchMgr.CreateLine 0.171, 0.0425, 0, 0.171, 0.018, 0
    swSketchMgr.CreateTangentArc 0.171, 0.018, 0, 0.169, 0.016, 0, 2
    swSketchMgr.CreateLine 0.169, 0.016, 0, 0.161, 0.016, 0
    swSketchMgr.CreateTangentArc 0.161, 0.016, 0, 0.159, 0.018, 0, 1
    swSketchMgr.CreateLine 0.159, 0.018, 0, 0.159, 0.0425, 0
    swSketchMgr.CreateLine 0.159, 0.0425, 0, 0.154, 0.0475, 0
    swSketchMgr.CreateLine 0.154, 0.0475, 0, 0.011, 0.0475, 0

'turn off direct addition to database
    swSketchMgr.AddToDB = False
End Sub

Outcomes