RayBounce on a linked model

The RayBounce function is precious when it comes to checking ceiling heights in order to place components, or to check program compliance. But more often than not, the elements needed “to bounce on” are in a linked model, and the OOTB RayBounce node only works with elements from the current document.

So, I took a look at the API and couldn’t find anything called RayBounce. After a little research I, as always, stumbled upon a post from Jeremy Tammik on The Building Coder that pointed me in the right direction: the ReferenceIntersector class. I then came up with the “RayBounce on linked file” node (Data-Shapes Package, code below). Because Revit doesn’t work internally with units other than feet, I had to come up with a unit conversion workaround. Using the Units and UnitUtils class, I was able to retrieve the UI unit type of the current document and convert the data to/from internal API units.

view raw

Bounce on link

hosted with ❤ by GitHub

The node is meant to be used in a very similar way to the OOTB RayBounce Node, although I could not find a way to set the amount of bounces (maxBounce). The node will return null values for the points that don’t have an element to bounce on, in order to keep the list structure as similar to the initial one as possible and facilitate data exploitation. I also couldn’t find a way to specify which linked model to perform the RayBouncing on in the API. An easy way to address the problem is to use a 3D view where only the appropriate links are displayed.



I also published a node called “RayBounce on Link Category” (code below) that allows to specify the categories you want your rays to bounce on :



Feel free to comment if you have some improvement ideas. Hope this helps save some time on the job!

3 thoughts on “RayBounce on a linked model

  1. I am new to this. i need to place family in revit using X,Y,Z co-ordination… X & Y value got from autocad to excel, for z value based on face i need to place a family. ( For example : like placing lights in ceiling based on autocad X&Y, based on revit model Z value). As of now i got script for placing family using X&Y co-ordination from Autocad to Excel to Dynamo. But for Z, i am not getting how to do. Please someone help to find solution.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.