hello I am trying to get a point X and point Y from the line, but eventually, I am getting an error
If you want to get the distance between two lines, you can use the node
Geometry.DistanceTo which will return the minimum distance between them.
To get particular coordinates from a point on a line, you need to get the point first. Options: