Wall "Connected" height

Hello, is there a way to get the actual height of a wall at a parameter?
like a sloped top wall connected to a roof?
The wall height will gradually change according to the roof slope but how could I retrieve that height at a given parameter?

Maybe Get the Face Geometry and then find the Z coordinate of the corners.