Make flying elements get hosted on closest ceiling

hello

i have some flying lighting fixtures with “not associated” host with a ceiling above it so is there a way using dynamo to make these elements get hosted to the first ceiling it hits in z direction? using ray or something?

also sorry i have no graph as i dont know how to get approach to the script

ty

Hi @abdelrahmanelfeky6

Could you share sample files?

1 Like

sample.rvt (4.1 MB) ty for reply

i made a sample with 6 not-associated lighting fixture and a ceiling above as the real model is so large

something here maybe

3 Likes

THANK YOU, as always it worked flawlessly
but i have a qustion, some normal horizontal ceilings and floors has 2 faces with z vector = -1. is that normal?
i usually use List.FirstItem at these scenarios but not sure if that a correct approach

1 Like

challenge :slight_smile:

can you make this work for Sloped Floors and linear Lighting Fixtures in a Linked Model.

just teasing a friend, no worries

1 Like

hehe cheers Marcel :wink: hope all good :wink: here is on a linked sloped ceiling and floors, so think so :wink:

2 Likes

you are welcome :wink: could you share that ceiling there give two -1 vectors, do your ceiling have some recess or something ?