Exterior finish of building faces (wall, beams, columns) script

Hi, I’ve been working on a script to create finishes (as thin walls) in exterior faces of buildings (the group of walls, beams and columns). It generates a surface that you have to export to .sat file and then you have to create a wall by face with it on Revit. Here it is:

I’ve tested it and it works when there are few elements selected, otherwise it doesn’t. The errors occur sorting the exterior curves of the polysurface in order to get a closed polycurve to create the new surface. I’m new in this, so I was wondering if there’s a simplier and better way or if anyone can please take a look for any correction.

Build a wall around the building’s perimeter then place a room between the “fence” and the building. Get the roombounding elements from that room.


Thanks, it seems like a simplier way to do it, but it needs some workarounds (like using the “fence” walls) and I don’t know if it works as I expect in all the scenarios. Is there any way to do it the way I’d planned it?

There is - but it is tedious.
You would need to do ray casting. Shoot a vector to the right and to the left from each wall - if it doesn’t cross another wall - it is exterior. If it does - then it is an interior wall or face. Maybe. It gets a little more complex if you have courtyards you want to work with or if you have a more complex footprint. Such as…

That will require some additional checking.

Room separation lines around the whole project and a temporary room do an excellent and quick job of finding the exterior of the building. I’d run with that.

1 Like

Thanks for the reply. In my case it’s not much of a problem of getting exterior walls, as you can can see in the nodes I’ve submitted you can select the exterior walls and then filter the exterior faces by selecting one exterior face. The problems is making this group of exterior faces (of walls, beams and columns) a proper new surface to work with mass and walls in place. As you’ve said the suggested exterior “fence” wall is a great idea but in complex shape buildings is difficult to apply. I was wondering about some new insight of the surface issue.

You can get the surfaces from the room object.
You can get the surfaces from the walls, but that is going to be more complex and require some use of the Revit API. (Haven’t seen a node for that - but there may be one.)

Thanks for the reply. In the nodes I’ve posted you can extract the exterior surfaces of the walls, beams and columns (light purple group) that’s not my problem, the issue it’s to get a correct border of this group of surfaces in order to get a closed polycurve (perimeter) and generate a new surface. With the nodes posted sometimes you get the result, it depends if the perimeter curves get sorted correctly or not repeated. With many elements usually doesn’t work, that’s because I was wondering if there is other nodes or a simplier way to get that.

A sample pic of the Revit model that doesn’t work might be helpful.
But just offhand based on what you’ve described, it sounds like there is going to be cleanup needed to check for intersections, overlaps and ordering.

Yes, that’s what I’ve tried on the cyan group of nodes, But like I’ve said, sometimes it works, other times it doesn’t so it needs some correction.

You have error in the pink before it gets to the cyan. And an empty list on your group curves resulting in empty lists in the cyan.

That was just an example for the image. It usually pass those nodes

…and the error reported by SurfaceByPatch?
And does the preview of the Polycurve.ByPoints look correct?

My example script would have like 3 or 4 nodes, not more

In this case the curves are sorted correctly after the pink block of nodes, the error is on the cyan block because it gets an empty list checking their points for a reversed curve. In other words it wasn’t neccesary check for reversed curves (I don’t know how to jump to a block of nodes or another acording to a conditional statement in dynamo, the IF works only returning values as far as I know, so that’s one other thing that I need help for).