There are multiple types of SketchSegments. A SketchArc is a type of SketchSegment. So is a SketchLine, SketchSpline, SketchEllipse, etc...
Dim you a SketchLine. Set it = to the SketchSegment of interest. Then you can use GetEndPoint2.
See the help for ISketchSegment.GetType.
Set StartPoint = skSegment.GetStartPoint2()
Set EndPoint = skSegment.GetEndPoint2()
Worked. I was looking through the API help for a SketchSegment method to do it but I never saw this. I guess it is inherited.
Thank you Josh!
if you have this in your code :
Set skSegment = swModel.SketchManager.CreateLine(x1, y1, z1, x2, y2, z2)
Then you have obviously if the construction is successfull, the created sketch segment is line and thus you have a sketch line.
A SketchSegment in this case (and only this case) can be casted into a ISketchLine object (otherwise do the type check like Josh said).
Do something like this:
Dim swLine as SldWorks.SketchLine
Set swLine = skSegment
Than you can use these methods to get the start and the end:
2016 SOLIDWORKS API Help - GetStartPoint2 Method (ISketchLine)
Be mindful that these methods can fail under certain circumstances.