How can I determine the correct sketch number of an item?

I have this line of code and if conditions or correct it will work.

Set myDimension = Part.Parameter("D1@Sketch16")

but if the criteria of the drawing deviates then the "Sketch16" could become a "Sketch18" or a "Sketch12"

Can I get the sketch ID so that I can code this similar to the following

dim X

dim y

Set skSegment = Part.SketchManager.CreateCircle(#, #, #, #, #, #)

X= Part.SketchManager.getID()

y = "D1@" & X

Set myDimension = Part.Parameter(X)

SolidworksApi macros