CreateLine2,How to use AutoDimension2

follow code ,

Set SwSketchSeg = SwModel.CreateLine2(0, 0, 0, 0, 0.01, 0) → SwsketchSeg is Nothing

*******************************

Private Sub ll()

   Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

       Set SwApp = Application.SldWorks

       Set SwModel = SwApp.ActiveDoc

   Dim SwSelMgr As SelectionMgr, Tmp

       Tmp = SwModel.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

       ''

   Dim SwSketchSeg As SketchSegment

       Set SwSketchSeg = SwModel.CreateLine2(0, 0, 0, 0, 0.01, 0)

       SwSketchSeg.Select True

       Stop

       Stop

       Stop

      

      

End Sub

SolidworksApi macros