Attaching Wall between floors

It’s been a few years since it was last asked, but it appears there still is not a means of attaching the wall’s Top/Base to elements in the Revit API. Instead you’ll have to edit the sketch. This isn’t super easy, but this post illustrates how that can be done: Sketch Lines - Edit, Copy, Paste - #20 by jacob.small

The difference between that example and yours is that you’d want to redefine the limits of the sketch to the top of the floor and the bottom of the ceiling/roof/floor above. Pulling the location line of the wall, and projecting it to the respective surfaces of the floor and roof/floor/ceiling above should do the trick; From there you can loft between the two curve sets, and use the perimeter curves of that surface to get the desired result.