question about Trim

hi, there,

I have a question about trim a spline, as see in the picture, I want to trim both side of the spline,

here's what I did:

I trim the spline and record the macro,

then unsave the file and reopen it,

run the macro, but the command doesn't work!

why?

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
Part.SetPickMode
boolstatus = Part.Extension.SelectByID2("Spline1", "SKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.SketchManager.SketchTrim(1, 0.02737693001443, 0.02848680555556, 0)
Part.SetPickMode
boolstatus = Part.Extension.SelectByID2("Spline1", "SKETCHSEGMENT", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.SketchManager.SketchTrim(1, -0.04871282693001, 0.03448402777778, 0)
End Sub

thanks very much

SolidworksApi macros