XYZ CO-ORDINATES

I require a macro that can get the co-ordinates of the endpoint of a line in a sketch and write it as a custom property.Icurrently use the measure tool which is time consuming as thecordinates have to be written down manually and entered as anannotation in the drawing.

Thank YouSolidworksApi macros