Loop while geometry intersection



I started looking at the Loop While node to resolve a problem… and already failed. Here is the deal, I have an intersection between a line and a solid, and I want the line to move on the Z axis while intersecting the solid (the solid doesn´t have a fixed dimension). I tried with the Loop While node but without success.

Can anyone help me with this?