Problem with excluding 3d geometry

Hello,
I’m trying to make a quite simple column and beam structure.
I’m trying to exclude the extra beams, so the beams that are not supported by a column but i can’t figure it out.

I hope that the script i wrote is useful and thank you for helping in advance!


190801_gridd frame.gh (16.7 KB)

Something like this?


190801_gridd frame_re.gh (29.9 KB)

Exactly like that!!
thank you.

I will study your script for a while! because i’m in awe!