Finding out if a Curtain Wall is embedded inside of another Wall


So not too long ago, a question was posed to me on LinkedIn – of all places – whether it was possible to find out if a Curtain Wall was “embedded” in another Wall, and if so, can we get a reference to that Wall. Now, the person asking, reached out to me partially by mistake, thinking that I am a maintainer of Clockwork package. Just to set the record straight here, I am not. That’s Andreas, and he rocks! I would love to have as much passion, patience and perseverance to keep maintaining a single Dynamo package for so many years. I am a little less “single focused” so to speak, and get easily distracted with new shiny toys. Sorry about that. Anyways, the question was really about one of Andreas’ nodes that would list out “inserts”. That node uses some of the new Revit APIs that are available since 2019 if I am not mistaken, and would allow you to get references to Elements that are hosted by the Element in question ie. Wall. Now, it doesn’t work in reverse though. There is no API to ask the Revit DB to return an Element that is hosting an “embedded” Curtain Wall. Having said that let’s talk about why is that in this particular case, because that’s not the case for all other Types.

So, let’s first define what an “embedded Curtain Wall” is. Specifically, what an “embedded” means. So I had a problem understanding that in context of a Wall. For me, when someone says embedded, it meant that one Element is hosting another ie. Family with a nested Family inside of it. That would mean that one Family is embedded inside of another. Another example would be a Curtain Wall hosting a Curtain Panel, where Curtain Panel would be “embedded” inside of the Curtain Wall. Question that I had, was, what does it mean to “embed” a Curtain Wall inside of a Wall. The answer was this:

Someone might say. Hola! Hola! Wait a minute. That’s not embedded. Technically that Curtain Wall has cut a hole in that other Wall, and just occupies a space that used to belong to it. Yup. That would be correct. So when you draw one Wall, over another, Revit interprets that operation as a “boolean”. It will subtract geometry from one Wall, to make room for another. However, they are not linked to each other in any way. The database holds this information internally to be able to calculate the amount of geometry that is being cut away, but it doesn’t expose that to the end user via an API. So back to our original question: If I have the Curtain Wall, how do I know which Wall it’s slicing and dicing? Well that’s simple:

Just to explain the gist of it before I get too into the details, the idea here is that if we can check the geometry of the Curtain Wall, against the geometry of the “host” Wall, then we can sort out what is embedded in what. Now on to the details:

First we have to get the Walls, and split the list by “Curtain Walls” and “Everything else”. That can be done easily by getting the Wall Type and checking it’s “kind”. Curtain Walls, will obviously have a Kind property set to something like “Curtain”, while all other Walls will be Basic or Compound if I am not mistaken.

This is really the hot sauce of this definition. The part where we take the two points (start/end) of the Curtain Wall Location Line, and check if its contained inside of any of the non-Curtain Walls. Why am I taking the two end points instead of checking the Bounding Boxes for intersection for example? Well, it’s possible that two Walls that intersect perpendicularly would overlap ie. intersect geometrically because of how Revit joins the ends of the Walls. In order to avoid these false positives, I decided that it’s better to make sure that two end points are contained inside of another Wall’s Bounding Box. Now, it’s probably possible to trick this rule with something like this:

However, this is not meant to solve every possible edge case. I provide consulting services, where if I am paid properly, I can spend another week accounting for all of these weird conditions. In the above case, I guess the solution would be to turn on the Volume calculations, and check if the Volume of the Wall is smaller that what it should be based on (Length * Width * Height). I am guessing the actual reported Volume for a Wall that has a chunk of itself cut away by some other Wall, would be smaller than the above calculated one. Anyways, that’s semantics and beyond the “free”, “random question on LinkedIn” scope.

To bring this home, we do a little bit of gymnastics with list management to make the association between Curtain Wall > Host Wall clear as day. The end result is two lists:

  • List of Curtain Walls
  • List of Host “regular” Walls

Their index numbers are matching, so now, you can go ahead, and do some other calculations around this. I guessed from the name of the sample file that I received, that this was intended for a COMcheck submission. I don’t really remember last time I had to do one of these, but yeah, having some sort of automated way of extracting areas of “windows” would have been nice.

As always, download file will be available on Patreon. Thank you for the continuing support. It’s much appreciated.

Support archi-lab on Patreon!

Leave a Comment