Get Hosted Elements of Joined Walls

Hi there!
I would appreciate some help with this problem:
I use to model walls with one type per covering. Example:

Imagem1

In order for my windows and doors to be hosted on all the walls, I need to use the “Join” tool in the Geometry in the Modify session. Otherwise, the window or door will only be hosted in one wall and will not make an opening in all the walls I need.

I am writing a code on Dynamo that will get the elements hosted on walls, because I need to apply some hiring rules about opening areas with my subcontractors. So I am using the “ElementGetHostedElements” node to get the windows and doors hosted on each wall and get the area of those openings and apply specific rules for each area in each wall.

However, I am having problems with this. The node gets the frames more than once in each wall, as many times I use the “Join” tool in the wall.

Does anyone know of another node or another strategy that I can use to map the frames of each wall that doesn’t multiply the amount when we use the “Join” tool?

Did you create the voids in door families?

Delete Wall Opening in all door families, and put Void instead. Constrain the edges of void extrusion 0.5 m away from the reference planes that sit on top of the faces of the host. Check “Cut with voids when loaded” in the door family properties pallet. All voids will cut the surrounding walls that are joined to the host of the door.

I created a dynamo graph that automatically joins walls by type with the surrounding walls. I can show you if you are interested.

Thank you so much Andrej for your help!

I followed your suggestion but unfortunately didn’t work. The same problem occurred.

For example, in the image above, I need the area of the wall e the area of the single one opening (image 4), but my code results in a wrong area, which returns to this wall, the 2 doors of the host selected in the image 1, which is joined to the wall of the image 4.

The method works. This is the proof. After you open the video, switch to HD.

Andrej, thank you for your reply.

Yes, the join process works, what doesn’t work is my code because of the join walls.

I wrote a code on Dynamo (image above) that get the elements hosted on walls, because I need to apply some hiring rules about opening areas with my subcontractors. So I am using the “ElementGetHostedElements” node to get the windows and doors hosted on each wall and get the area of those openings and apply specific rules for each area in each wall. However, the node gets the frames more than once in each wall, as many times I use the “Join” tool in the wall.

The parameter I am trying to create for the walls is to calculate the area of the walls according to labor hiring rules.
I need to obtain the net area of each wall and add the area of the openings to it according to the following rules:

  • When the window or door opening is smaller than 2m², the total frame area is added to the wall area.
  • When the window or door opening is between 2m² and 4m², half of the frame area is added to the wall area.
  • And when the window or door opening is larger than 4m², nothing adds up.
    But the code I wrote results the wrong area because of how the frames are hosted on the walls and how the walls are joined.
    I’m having trouble finding different nodes that identify the frame openings for each wall.
    I didn’t find any node that identifies the geometry of the wall and its opening without using the frames in the code.

Ok, I think I get what you want now. This is my idea on how I would get around this, but we will need the help of others, because I don’t know how to write the nested IF statements, whether it is DesignScript or Python.

p.s. I don’t know what you mean by “frame area”, so I just assumed it is the area of opening. If that’s not what you meant, we can change it easily, once others help end this graph, because its the skeleton of solution…

EDIT: fixed the image upload

By frame I mean the windows or the doors. You are right.

I finally made it work and figured out how to write an IF statement in DesignScript.
Consider this principle.

EDIT: fixed the error about the connection between two nodes

Thank you Andrej for your efforts!

I really tried several codes but none of them results in the right area. :cry:

Did you try your code with more walls and openings? Because I tried it with the follow 3D model and works, but results in a wrong area. There are 7 walls, 2 doors and 2 windows. Only the sum of the 4 openings with the first 4 resulting walls was made. And I think that y1 and y3 are swapped with each other.


I think the problem is in how to map the specific door/window that is attached to each wall. My first code didn’t work (in my first post) because by joing walls, all host’s openings are considered in the joined wall. This is the expected result, but for a model like from the imagem above, for example, to Wall 1, the code results in an area that adds up all the model’s windows because all the windows are hosted on Wall 4 which is joined to Wall 1.
And one more problem is how the join tool was used. It doesn’t need join all walls to the opening host to make the opening, so, some walls aren’t joined, but exists an opening. This results in walls that do not add up to any opening area in my first code.

Can you please upload your test .rvt file, and I’ll take a look tomorrow or today late evening? Also, It could be that I rushed, and made some mistakes. Please correct me if I’m wrong or comfirm if I’m right:

A = area of the opening
B = area of wall that has an opening (so the actual area is without the area of the opening)
C = overriden area of wall

if A < 2
C = B+A

if 2 < A < 4
C = B+A/2

if A > 4
C = B

Perfect, that’s it.

Here is .rvt file:
Test.rvt (3.2 MB)

Here my first code:
parameter test.dyn (51.1 KB)

Here your code that I made some changes:
parameter test2.dyn (34.1 KB)

1 Like

This is it, I think…
Use clash detection.
Just translate from English to make it work in your Revit version…


Override Area.dyn (52.4 KB)
Test Override Area.rvt (3.0 MB)

2 Likes

Hi Andrej!

Perfect! It works! :smiley:

I tested it on a larger and more complex project. To make it work, I adjusted the radius of the created “Sphere” to a smaller size so it wouldn’t interfere with other walls (but at least the total size of the wall). Additionally, I changed the input “z” of the “Geometry.Translate” to half the height of the openings to also avoid interference with other walls. This way, the “Sphere” is positioned in the middle of the opening.

Sorry for taking so long time to reply. We have been testing the code during our busy days. Today, we were finally able to finish the tests. I can’t express how much this will help us. Thank you very much.

1 Like

you’re welcome