Revit MEP copy/monitor from linked file and more

Hello, I’m new to the forum and to dynamo. Just starting to grasps some of the very basic concepts and I’m looking for some more detailed guidance. Any help would be greatly appreciated. Thanks in advance! I’ve included the .dyn file, screenshots, and thorough description.

DrainsImport2.dyn (34.0 KB)


I’m trying to develop a dynamo graph that will copy certain plumbing fixture (drain) elements from a linked structural model into an MEP model. I’m also filtering out the ones that have the word “enlarged” in their name. The drains that the structural modeler uses are very generic. The drain is actually a Revit family, but contains no 3D content, only a 2D symbol, which can be seen in the attached screenshots. Once the drains are copied in, I plan to manually change each of them to the correct MEP family/type/size they need to be for the overall design I’m working towards, which you can also see I was able to do in the second screenshot.

So far I’ve been successful with getting the graph to copy in the drains and I’m able to manually change the family, as needed. However, the drains are not coming in at the same X,Y-coordinates as the linked model. What am I missing to make these align?

Other enhancements to get input on:

  1. The drains in the structural model are placed at the Revit floor level and don’t take into account any floor slope. As an MEP modeler/designer, is there a way to add something to the dynamo graph (or maybe a separate graph), that would move the drains down in elevation (Z-coordinate), until they are flush with the top of the concrete family used in the linked model?
  2. Is there any way to use Dynamo to copy/monitor these elements so I can be notified of any changes made in the linked model? If not, I envision needing to run this graph multiple times due to location changes or added/deleted drains by the modeler of the structural linked file. Is there a way to ensure that duplicate drains are not created if the graph is run over and over again? I suppose this could be very challenging, if #1 above can be implemented. I’d like to think there’s a way to compare if a plumbing fixture category element already exists in that same X-Y coordinate and ignore copying it if so (wouldn’t be able to compare the Z-coordinate if a resolution to #1 happens). But then a complexity exists that there will most-likely be drains in the exact same X-Y coordinate location on multiple different level of the total project, if we ignore the Z-coordinate.
  3. Ensure that the “plumbing fixture” model category is turned off in the linked file for view template named “Plumbing – 1/16”.
  4. If the MEP model drains and associated piping are all connected and belong to a Revit system, will there be any problems with ‘disconnect’ when I run the graph over and over?

Misc information:
Using Revit 2019 with Dynamo Core and Dynamo Revit

Update - I was able to figure out the main issue and align the drains in the XY-coordinates with the following graph (doesn’t include the filtering portion yet). Now trying to figure out how to move them down to line up with the sloped floor (#1 above).

DrainsImport3.dyn (20.5 KB)

About question #2:

I guess there are at least 2 ways you can make it.

  1. Ray casting to downwards, till it hits on your target floor/slab. Set target type of your ray to “Element” or “Face” depends on your need. Then place your family on it.

  2. I suppose there should be something to represent the families’ location which exists in your linked structural model. Either a Level parameter or just its Location property. That should contain the value Z.
    Generate a list of 3D coordinates to excel. Bring it back to the MEP model then place your families.

Do you have any examples of this ray casting concept? I haven’t been able to find anything that has worked for me yet. Thanks!

Ray casting isn’t standard is it?..what nodes or packages would be required for ray casting?

Hi Justin,

Let’s say I have a television floating in the air. Now I want to cast a ray downwards starting from the bottom till it hits the floor in order to retrieve an reference of the floor.

I drew a line connecting the points (start and hit) and two little circles for each of them only to make them more obvious.

There should be some packages will accomplish this as well, but you might need to research a little bit more.

Behind the scene, it is “ReferenceIntersector” that helps you find things you want. Either a linked element, native element in current model or a piece of geometry, it is capable of finding it.