Joining multiple walls to one wall

The office I just started in models 3 walls as one which means you have to join walls so that the openings from doors/windows are made in all 3 walls.

I found various scripts after searching on here but couldn exactly get what I wanted. The script I made uses a selection to pick the 3x external wall layers, it then uses these to filter the same types from all the walls in a project. I then generate lines, and intersect those, all this works except the last step. When joining I have two lists, one with the middle wall (insulaiton) and a list of pairs containing the internal an external wall.

What I can get to work is the joining of two walls to one, it joins some walls but not consistently all walls.

For some reason I can export an image from my script, or I can´t find the image, Iĺl upload it here. These are the last two lists before the join node which I want to joion.

I tried different ways of lacing and levels but to no avail.

Level and Lacing wise this should work :thinking:.

I haven’t used the Clockwork node but I’m guessing it works the same way as other nodes of similar functionality. When joining elements in Revit, it’s common for one element to “take over” as the main element. This element retains any of its parameters that weren’t affected by the join as well as its ElementId (this is the important part). If you’re going to join multiple elements, you need to ensure that all additional elements are being joined with the “main element”.

If you want to join four elements (with ElementIds 1, 2, 3, and 4), you actually need to join any three of those elements to the same remaining element ( e.g. 2, 3, and 4 joined with 1). Element 2 gets joined with 1, leaving the new Element 1. Element 3 gets joined with 1, leaving the new Element 1. Element 4 gets joined with 1, leaving the new Element 1. Otherwise, you’ll end up trying to join one element with an element that no longer exists.

The problem you’re having is that you’ve defined your first element, element1, as the list to join, instead of the element to be joined with. Wall 1928257 joins with Wall 1928253. Then when you go to join Wall 1928289 with Wall 1928253 again, the latter no longer exists. @bvs1982 shows that you can fix this by using the correct list levels and the correct order of inputs.

@bvs1982 I tried different lacing and levels but didn get it, your example worked, however I didn understand why. @Nick_Boyts explained it very well and its much clearer than before.

I did run into my next problem. My test script filtered out all walls for one level so that it was a easier for me to follow the script. I thought I could change it to not filter levels and it would still work. Alas, that was not the case. I also ran into some other problems related to how we may model a typical building and started the script over (similar principle).

In the script below/attached, I am grouping the walls per level and then filtering out the insulation so I have a list of insulation walls and all other walls. Then using Element.GetLocation I create curves for all the other walls and make a perpendicular line, I intersect these perpendicular lines with the lines from the insulation using a Geometry.DoesIntersect node.

My list structure is (walls) per level, what I wanted to do was to intersect the curves for each wall per level and generate a list of walls per level with a sub-list of (typically) two walls which I can then join up with the common wall (like in the OP).

I cant figure out how to accompish this, or at least I am not seeing the results I was expecting with the intersection. I was expecting a list with sublists for each level, with two items per sublist.


Above, I know that item 0 in the insulation list is parallel to items 0 and 4 in list 2 of other walls., and item 1 is parallel to items 1 and 2 in the other list.

I think I should see a sub-list for each of the insulation walls with a list of 4x true/falls items. (I realise the lacing/levels are incorrect in the example because I was trying different combinations).

My next step is to cycle through the other walls and make a list which matches the insulation wall to a pair of parallel walls. If I can get this then I’m able to join the pairs of walls like in the above.

Join external walls.dyn (1.7 MB)

—edit—

I realise after trying a few more things I should be approaching this differently. At present I’m trying to match walls to insulation. I think I can also (maybe better) match the insulation walls to the walls for which I am trying to make the intersection.