Trying to find intersection of 2 sloped beams

I am trying to find the intersection of two beams and I can almost get there, but because the two beams have different elevations  / are sloped , it splits the difference in the Z direction at the point where they cross. I would like it to find the z value on either beam A or beam B at the point where they cross, like how when you measure in design the first one you pick is the one that defines the Z value with the 2nd pick projected onto that line if that makes sense. So it's still the intersection but on the line of first picked beam.

I tried using point vectors and planes with no success.

Any help is appreciated.