Group aligned walls

Hi everyone

Please consider that what looks as layers of compound walls at the image below are actually individual basic walls aligned with one another.

Any tips on how can I verify wich wall aligns with wich, and then group the aligned walls in lists? First I tried to retrieve each wall interior and exterior faces, then check for intersections, but it returned a list that I found too complicated do use. I have no clue how to cross-reference the intersections with the original walls.


teste_leEspessurasParedesAtualizaParametro.dyn (31.2 KB)
teste.rvt (732 KB)

Hi @rodrigo.bezerraRD5KM ,

This problem is more complicated then you would think at first.
How would you, for example, define walls that align and how could you then possibly group them? (From a coding perspective)

Hi @Daan,

Yeah, I understand that’s quite tricky. From a coding perspective I do not have the slightest clue how to do it, since I can’t code.

I thought about some scenarios:
Group the walls by direction, then group again by paralellism, and at the end check if the bounding boxes intercept each other… But even without testing it, seems a little weary and uncertain.

Another scenario would check the distance between parallel wall centerlines, if they’re within some predetermined range, but it sounds even duller.

1 Like

I think grouping walls by their direction might just work as a first step.
(Keeping in mind the ±180 degrees rotation).

I’ll see if I can create something basic that works.

1 Like

I was thinking of this like a first step to accomplish this: if I have a door or a window in any of these walls, Dynamo would recognize the sum of the grouped walls widths and adjust the door or window trim to fit the finished faces.

However, as it is getting complicated, I’m rethink my workflow begining from the door or window. I’ll work at this alternative and share the result if I succeed.

1 Like

I got something to work :smiley: :


The workflow:

  • Get the two biggest Faces per wall. (Assuming the wall is a rectangular shape.)
  • Extract the perimeter curve, as PolyCurve, per Face.
  • Extrude these PolyCurves inwards. such that they are a bit smaller than the original PolyCurves.
  • Using these new PolyCurves, as CrossSections, create new Solids.
  • Now these solids only touch their correct solids grouping by distance is possible:


2022-05-02 Group Walls.dyn (54.7 KB)

1 Like

This is great! I was hopping for tips and you got the work done. Thank you so much!

If I may, running the dyn I’m getting an error at the group that creates smaller solids. I think that’s something about the -150 offset. The number is either too big or too small. May be the units? I’m testing in a model in meters.

That could be it, is that the same model as the one you send on the Forum?

Also, there should only be 2 polycurves per list instead of 6, could you share a screenshot including the input?

It’s a slightest different model that the one I shared at the same post.

TesteAgrupamentoParedes.rvt (2.5 MB)

That’s what happens running the dyn at the attached model:

I’ll take a look later today

1 Like

Hi @rodrigo.bezerraRD5KM ,

There were 2 main reasons the script failed on your new/ more complicated walls:

  1. The first bug was the way the biggest two curves were selected, I changed that now so that it always works, even when there are multiple windows/ doors in the wall and/or the wall has a non-rectangular shape (Haven’t tested it out on really weird shapes though).
  2. The second problem was the occurence of one or more windows in a wall. When this occurs multiple correct perimeter curves (PolyCurves) can be extracted. This is now solved by grouping the curves first, then sorting them by length and then getting only the last item, which is always the PolyCurve representing the perimeter.



2022-05-02 Group Walls V2.dyn (63.0 KB)

Amazing! Thank you so much