Set Parameters based on Intersecting object (for multiple objects)

I have Pipes that are intersecting floors and walls, I would like to size an object based on the Floor Thickness/Wall width, Pipe Diameter and I would like to rotate the object so that it is oriented the same as the pipe it is on.

If I have 4 pipes it creates 4 objects but they all spawn in the same location
Getting the Floor Thickness only ever uses the first value into consideration.
Pipe diameter seems to work as far as I can tell
No matter which vectors I try to rotate the objects around they just spin around the Z axis.

Script attached
Script.dyn (183.7 KB)