Fit a curves x/y to another curves Z


I’m sure that this is a normal rhino function but I have been trying to find this online and can’t seem to find a solution.

I have two curves, (1+2). I want to essentially flatten curve 2 then align its Z points to fit vertically along curve 1.

Is there a way to do this?