Wall take-offs based on shared spaces/rooms

Hello, everyone

I have this mechanical design situation where I need to calculate the airflow differentials in a network of spaces to based on the pressure setpoint for each space. Fortunately, I have already created an XLS workbook that can do this. The problem is, it requires a lot of input. I’ve managed to script information transfer from the project file to the XLS for some of this information.

The obstacle I’m facing is this: I need to identify unique space-to-space relationships and retrieve the length of the wall that separates the two spaces. This presents a special problem due to the fact that it’s not enough that a wall separates the two spaces; I need to know if only a portion of that wall separates those two spaces and the remainder of the length of that wall separates other spaces (Think corridor in an office building. The corridor wall can be “X” feet long with a bunch of office along the corridor, so each wall section dividing the corridor from each office is some fraction of “X.”) Is this something that can be done by intersecting room boundaries? I don’t have much experience dealing in Dynamo nodes with Rooms as I am a lowly mechanical engineer.

BTW, is there any particular reason all this geometry content is for Rooms and the content available for Space is scant?

Thanks for your help!


  • what do you mean by “space-to-space” relationship? you want to construct relationship between space and walls (or portions of them) that circumscribes it? Or wall is not important at all, just the bottom edges on interior faces.

  • I would say Room and Space are very similar, geometry-wise. I suppose the perimeter curves on bottom face of Space geometry are quite close to what you are trying to achieve.

space boundaries from Revit sample project.

I mean that if Space A and Space B are divided by a 30-foot wall but the portion of wall that “touches” both spaces is only 6 feet, I want to report the name of Space A, Space B, and 6 feet in a sublist. I want to do this for all of the interior walls separating spaces on a level.

So, as a starting point, I’ve been working with a script that Vikram shared in this post:

I’ve attached the sandbox RVT and the DYN. You’ll find that I’ve modified the script in the green code group to display all rooms with adjacencies. In blue, I’ve identified the rooms that touch the walls. The nodes in ungrouped clusters have not been vetted, but I appear to have some semblance of the information I’m collecting. The next thing I’m going to try and do is to create a new list of the adjacent Rooms in pairs. Then, I need to determine the overlapping lengths of shared boundaries; I’m thinking this needs to be done by getting the element locations of the Room Curves, and somehow compare it to the locations of the intersecting walls to identify which boundary item in the Room sublist needs to be “analyzed.” In this case, I’m thinking the starting and ending locations of the single boundary item will need to be compared, and with some coordinates math, I should get the common boundary length separating two Rooms.

Does this seem like the direction to go? Are there any nodes that will do some of this that I just don’t know about?


And sorry for the oodles of nodes all over the place. That’s me trying to figure out what all of these nodes can do.

space_element_space.rvt (1.3 MB) 3.1 WallAdjacentRooms.dyn (85.1 KB)


file first:To_Joe.dyn (37.9 KB)

I can tell your method is:

  • Room center boudnary

  • Polycurves

  • Intersects or not

  • Remove self-intersection

  • Get the rooms that intersect a room

I think you are very close to achieve it:

When using polycurve intersections, you’ve already had the chance to retrieve the length.

DoesIntersect gives a boolean mask whereas Intersect gives geometry. In your example, the intersections are either NurbsCurve or empty.

So try the following:

  • Use List.Combinations to get the room pairs.

  • As to each combination,
  1. create polycurves from room center boundary and check intersections. Just ignore empty result. For example, the combination of Room 3 and Room 5 will be ignored.

  2. Get points from intersection result (NurbsCurve). Create polycurves based on the points.

  3. Get curve members from polycurve, compute total length.

  • Verify output, see if the relationships are correct. (First Item in output.)

  • Get spaces and see which one is related to the room.

  1. https://www.revitapidocs.com/2020/f107fbd8-4e76-735a-78d5-d640a266b3a3.htm Space has a Room property, so you can get Room from Space.

  2. Let’s just iterate through all spaces, see which one has the target room. Collect findings.

It worked in your sample file at least. But I’m not sure if the intersection result will always be NurbsCurve. You don’t have to improve your script with Python Node, it’s just the way I prefer, combination of nodes and Python. It’s easier for me to build relationship between different things.

I don’t have the packages you’ve installed so I replace some of them with OOTB node (Like how I retrieve rooms just by Select Model Elements)

Guess it would work if you have a Space.CenterBoundary then the rest is the same and even easier without last step of matching for spaces. There might be one, a lot of interesting nodes out there.

> I have this mechanical design situation where I need to calculate the airflow differentials in a network of spaces to based on the pressure setpoint for each space.

I worked with Mechanical stuffs as well. Just curious, how is your question related to airflow differentials?

1 Like


That is wild. I appreciate your help in this. I see what you’ve put together, and I’m reverse engineering it to see if I can construct it with nodes with the procedure you’ve laid out (and the way you scripted it). I definitely understand the merits of coding the nodes; when it comes to processing the extensive amounts of data I’ll be facing, it sure will come in handy. It’s just that I cannot code, so I want to make sure I understand how the coding works.

I’m sorry, but I don’t understand the consequences here. I’ll do my best to google and try to understand what this means, but can you give me a hint?

In occupancy types like pharmacies and laboratories, different pressure relationships are expected to be maintained between different spaces; for example, operating rooms are positive pressure relative to the corridor that connects to it, and locker rooms are negative pressure relative to both of those. Air flows between these spaces through partitions as well as doors. If all three of those spaces share walls/doors/etc, then the designer needs to make sure that air is available to go through these different paths. I have an Excel calculator that determines how much air to supply and return in each room to make sure that it maintains a specific pressure in the space when it’s surrounded by a bunch of other spaces that have different pressure requirements. The calculator is all set up to process data; the hard part is getting all this data entered (like all of the partitions separating each room). I plan to write the information that you helped me harvest into the calculator so I don’t have to do manual data entry.

Next steps for me in developing the script is to identify doors in the shared partitions and other openings after that. For now, this is leaps and bounds beyond what I originally expected to get.

1 Like

I just wanted to post an update to my replication effort; I think I managed to go through your coding and basically repeat your code with nodes:

Some of the functionality is different once I got excited that it was coming together. :laughing:

I still need to research with NurbsCurves. You’ve been a tremendous help, @jshial. I really appreciate it.

I don’t know if this has something to do with what you were mentioning about NurbsCurves, but I got this error when processing the Rooms in the project I’m trying to apply this to.

This is the version of the file I’m working with that resulted in the image below:
3.3 WallAdjacentRooms (share 1.1).dyn (80.5 KB)

I found that I got output that shows spaces that were diagonal from each other at a “T” and the wall overlap distance was blank.

An image of part of the plan that has these issues:

An image of the section of the calculation that lists these “relationships”:

file first: To_Joe (share 1.1).dyn (34.6 KB)
check your output from Geometry.Intersect. For those rooms that are not “connected”, Empty List will be the intersection result. Feeding empty list to NurbsCurve.ControlPoints, it’s just complaining the empty input, so it goes to downstream as well. Filter your combinations at this point, using Empty Lists as false mask, carrying the combinations that do have intersections in order to match up with the final length results.

And it seems like PolyCurve inherits Length property from Curve, so sums up length from member curves is not necessary in my code.

I was thinking there could be other kinds of intersection result as well, say a Point maybe (depending on room models). Let’s just assume it will be NurbsCurve exclusively for now.

I just have a superficial understanding to NurbsCurve, kind of like a curve with several magnets (control points) that have impacts like pulling, dragging. I just took whatever Intersect gives me and tried to retrieve length from them.

@JoeB I took a detour :oncoming_automobile: NurbsCurve has Length property. wth

file first: To_Joe (share 1.2).dyn (30.5 KB)

I see; so I’ve implemented this change, and there’s one more issue. The list lengths for the wall lengths and the list of “shared Rooms” don’t match.

Based on the preview in the background, I’m guessing it’s because some rooms share more than one wall. I’m trying to figure out how I can verify this by the lists, but it doesn’t appear to be as simple as selecting the line in the list in the script. If I’m right, I need to figure out how to sum all of the curves that share a room instead of listing them separately.

Just an update:

After going through the lists, I’ve found that the NurbsCurves are sublisted for each intersection, and when we flatten the list out, the relationship with the Room List changed hence the different list lengths. I’m going to work on cleaning the list up and see where I get.

And yet another update:

I’ve cleaned the list up, and now I’m showing a difference of two sets of rooms with no walls. It’s as if the goal is just out of reach…

So, I needed to further filter the Room set list by removing the entries that had points instead of NURBS Curves. There were two which effectively matches the wall take-offs list. The resultant script was reconfigured as shown:

It appears to work the way I intended it.

I thank you very much for your help, @jshial. I hope to one day return the favor.
As a side: I want to give you credit, but I don’t want to skew the “Solution” feedback; this really has been a process.