Sketch Trim

Hello everyone,

I am having some difficulty trimming a created sketch via my macro. Attached are images of what I am starting with, what I need and then what my code is outputting.

I have tried all the different options for .sketchtrim and have tried to move the order which I select the objects. My code below is the only option that outputs anything close to what I need.

Thank you for your help

bRet = swExt.SelectByID2("Spline4", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)

bRet = swExt.SelectByID2("Arc1", "SKETCHSEGMENT", 0, 0, 0, True, 0, Nothing, 0)

If bRet = False Then Debug.Print "SP1 Error"

bRet = swSkMgr.SketchTrim(2, 0, 0, 0)

If bRet = False Then Debug.Print "SP1 Trim Error"

SolidworksApi macros