Script to Align MEP Elements to Ceiling Geometry

There was a previous thread from another user regarding this topic which I had followed up on and the trail went a bit cold so I am posting as a new thread. Here is a link to the previous: Align MEP families to different Ceilings in Linked model

What I am looking to do is create a script which will allow users to justify all ceiling diffusers and grilles to the ceiling of a linked model.

I am utilizing a dynamo lines intersection method that I believe is adapted from something Sean Fruin had created. I believe that the script is very close because when I substitute a constant value for the variable Offset_= under the “//Get Offset from Hosted Level” section the script runs and moves all the air terminals to that value. The generated dynamo lines are also visible in Revit when I run the script so I know that they are being created successfully. It seems to me that the issue is somewhere with either a) the ceiling intersection point not being properly created or b) the intersection point not being read as the variable Offset_=. Can anyone shed any light on where the issue might be? Screenshots below:

1 Like

Did you create this from scratch or copy from someone else? Nothing wrong with using someone else’s work they shared, but it does make it hard to troubleshoot if you don’t know all the pieces. If you haven’t already, I would confirm all the outputs from this block and make sure they all make sense. It would also be helpful if we could see those outputs rather than guessing at what’s happening in the background.