So I haven’t done much MEP work on this blog, simply because I used to work in Architecture so most of the tasks that I have ever worked on were “inspired” by the kind of work that Architects usually do. However, recently one of my Patreon supporters asked if I could look at an MEP workflow that he’s been tasked with. It was basically looking for locations in the MEP model where Ducts were intersecting with Architectural Walls. I guess that’s a very typical workflow for the MEP guys to want to automate. The idea is that when a Duct hits the wall, you want to place a Smoke Damper there, as to prevent potential spread of smoke in case of a fire. All sounds pretty straight forward. Here’s a Dynamo approach to that issue. Also, as a side note, the below definition is a combination of what I received from Bachir, and what I thought would be an interesting subject to actually write a post about. His exact issue and a solution he was looking for was a little bit different than this. Bachir – sorry for butchering your sample file.
OK, so if you think about different steps that one might want to take when putting together that workflow I would categorize them as such:
- Get all Ducts
- Filter out “vertical” vs “horizontal”
- Filter out “round” vs “rectangular”
- Any additional filters based on properties of the Wall/Duct. Not every intersection of Duct/Wall would normally get a Damper, but I didn’t want to get too much into details. the purpose here is to demonstrate a generic solution not a specific one.
- Get all Walls
- We are assuming Walls live in Architectural file, so I set this up as if Walls were in a linked model.
- Intersect Ducts/Walls
- Place Damper at intersection points.
Here’s the full definition:
Here are some of the more interesting parts of the script, and explanations about why things are the way they are:
What’s so special about this? Well, normally we use “Categories” node to get all elements of a given Category. This normally works well, but there is a weird thing about Revit that not everyone knows about. Not every Revit file will have the same Categories. Surprise, surprise. Well, not really. Why would you want to load up all of the MEP Categories into your Architectural model etc. Because models don’t always have the same Categories, the dropdown node, that contains a list of them, doesn’t always display they same items, in the same order if it was opened in a different file. That sometimes causes issues. The above way of getting a Category solves that potential issue.
One way to identify a “vertical” Duct, is to check its Slope parameter. If we are dealing with a Duct that has no slope/empty string – then we know its a “horizontal” Duct.
We can also identify “rectangular” and “round” Ducts , simply by looking at the existence of a Diameter parameter value. Pretty much the same routine as the one above.
At this point we would have all of our “horizontal”, “rectangular” ducts. I am only going to deal with these at this point. Maybe in the future, we can add handling for the other ones.
Now that we have our Ducts, let’s get Walls.
Nothing to explain here.
Next, up we are going to intersect them. Once we have the results, we can use them to check which Ducts had an intersection. I want to filter out only Ducts that go through Walls, so I can place a Damper on them. We can use List.IsEmpty node here, since the result of the Geometry.Intersect will be all Empty List if there was nothing that intersected with our Duct.
Finally we clean up our list of nulls, and empty lists, and get our intersection points as Solid.Centroid. The reason we are doing this, is because Duct geometry is actually a Solid, and so is Walls’. When you intersect two Solids, you get a Solid back. We need a single point, so the best approximation is to get one from the center of the Solid.
Finally, I added a node to Archi-lab.net package that places the Damper family at specified point. The way this happens is a little convoluted since Revit’s API doesn’t exactly make it simple. If I was to split this process into steps they would be:
- split the duct into two
- place the damper
- rotate damper to align with duct
- set width/height of the damper to match that of duct
- connect duct connectors with damper connectors.
- I am not much of an MEP expert, but I guess that’s the part that makes it part of the same system as duct is. I was just interested in cleaning up the geometry, as it looks better when end of duct is connected to end of damper. It cleans up nicely.
As always sample files will be made available for download for my Patreon supporters.