How can get midpoint and endpoint coordinates of selected line API

is there a simple way or function to get the end line of selected line,  from drawing view, am looking to shorten a process of tag-ing select items in a drawing view,

SolidworksApi/macros