Randomise horizontal grids on curtain wall - Getting height value

Ah yes it is failing because you need to modify the code block like I described here:

image

This is the part you want to change - rather than applying curtain grids at points across the location line, you need to construct a line on the curtain wall in the Z direction. Try changing the code block to this:

p1 = curtWall.GetLocation().StartPoint;
p2 = p1.Translate(0,0, height);
line = Line.ByStartPointEndPoint(p1,p2);
points = line.PointAtParameter(params);