Here is a little macro I made to get all the 9 preset positions on a beam (for example Centre-Right, Top-Left, Bottom-Centre etc).
This gets the lines regardless of the justifications or rotation set on the beam which is useful as sometimes Location Curve doesn't cut the mustard so to speak when exporting or analysing the linear geometry.
I have added this to a growing library of extension methods and utilities to be used in .net to aid in plugins/programming with analytical geometries. Also, it was a good opportunity to test some of my maths knowledge I have picked up over the past years at Uni.