SpotCoordinate.ByPoint error

Yes, but a vector (line/curve) from the origin.

See if this post can help you.
https://thebuildingcoder.typepad.com/blog/2010/01/spot-elevation-creation-on-top-of-beam.html

Or this