Wall Start & End to PointsByCoordinates

I’m trying to get the X,Y,Z points of the start and End of a Wall then create Points.ByCoordinates based of those locations.
(Background: I’m getting the wall length, adding a slider for Pile spacing, and inserting Family Instance at each of these points equally spaced)
This should be straight forward but I’m getting an error.

Working in Revit 2016

 

wall_points

Hi Matt,

You’ll need to use “Curve.Start/EndPoint” on the wall curve before you can extract the XYZs

That worked perfect thanks, but I think I’m going down the wrong path for this.

I’m able to draw a horizontal x axis aligned wall and have the foundations equally spaced as I adjust the wall length, start & end points.
My next problem is when the wall is vertical Y axis aligned or off angle. I started going down the path of Trig, but I’m thinking there must be an easier way sense we have the curve line of the wall?

Suggestions?

Node below.

Working-Place_Pile_Based_off_Wall_and_Spacing

temp_wall.