Selection of Axis in drawing sheet view for Adding dimension

I am selecting an axis from the component’s feature and an edge in the drawing sheet to add a dimension. While doing this, I am recording a macro. However, when I delete the added dimension and run the macro again, it does not work properly. It only selects the edge and adds a dimension to the edge itself, instead of selecting the axis again.
Below is the macro .

' ******************************************************************************
' C:\Users\kumarit\AppData\Local\Temp\swx18552\Macro1.swb - macro recorded on 06/13/25 by kumarit
' ******************************************************************************
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.ClearSelection2 True
boolstatus = Part.ActivateSheet("Page 1")
boolstatus = Part.ActivateView("Drawing View3")
boolstatus = Part.ActivateSheet("Page 1")
boolstatus = Part.Extension.SelectByID2("Axis1@Draw3-SectionAssembly-1-1@/TSB_Bed 1_PackingSupport-1@Draw3-SectionAssembly-1/TSB_Bed 1_TSB-BR_5-1@TSB_Bed 1_PackingSupport", "AXIS", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = Part.Extension.SelectByRay(9.62240527127738E-02, 6.15553776408432E-02, -11005.0267645, 0, 0, -1, 2.17723019582927E-04, 1, True, 0, 0)
Dim myDisplayDim As Object
Set myDisplayDim = Part.AddDimension2(7.61807276746984E-02, 6.42977963816932E-02, -7.33439808778791E-03)
Part.ClearSelection2 True
boolstatus = Part.ActivateSheet("Page 1")
boolstatus = Part.ActivateSheet("Page 1")
Part.ClearSelection2 True
End Sub