Find the midpoint coordinates of a sketch segment

Looking for API call or VBA example of how to extract the midpoint coordinates of a sketch segment, whether a line, arc, spline, etc. 

SolidworksApi macros