Dynamo fails to fetch room geometry

I have a simple exercise where I have to write room name into a family parameter if the family is in the room.
I know about the point is in room node but this case it is not useful for me as i have to scale the rooms up so they will contain the bordering elements on the facade.
The main issue is I have 3000+ rooms and when I try to fetch geometry revit just goes stall. I left it overnight maybe it will finish but it did not. I tried to get the boundary curves so I can do a patch then an extrusion but that one fails for majority of the rooms even though they are bounded. Many room returned curves that made no sense and it was not possible to group them. I tried to do it level by level where I only have 500 room in my list but i get the same result.
I’m out of ideas how this can be done.
I’m pretty flattered if it is even possible at this point.

hi @daninet90

are you also trying to get the intersection of room geometry to any geometry?
if that is the case, I think, you have insufficient RAM.


Not yet. So far I only have a handful of nodes to filter zero area rooms then get the element geometry.

can you share a screen shot of the script?

i have 64gb of ram, it should be plenty. Revit is not using quarter of it.

hi @daninet90

Is it possible to get a copy of your dynamo code and your Revit file (a sample file will be OK if it also fails to the script).

I also have 64GB of ram but when I run a 200+ room script and get the rooms intersection to 30,000++ pipes, I always get the error of memory full.


Do it in chunks as you noted before.

  1. For everything inside the building use the PointIsInRoom method in the first graph.

  2. For windows and doors, first filter out windows and doors who have a ‘Room’ value from #1 above, then use the from room value, unless that is blank in which case replace the value with the ToRoom value.

  3. For remaining families, first filter out families who have a ‘Room’ value from #1 above, and then merge all the room geometry into one solid. Next get the location of each family instance and break that number down to a point. Next find the ClosestPointTo on the room solids to the point in question, and build a vector from the location point to the closest point. Translate the location point along the vector by the vector’s length + an overrun distance. Then try the ‘room at point’ method from as before.

1 Like

Hi! Thanks for your reply. We are diverting a little bit from the original topic that I’m not able to get element geometry for >150 rooms at the same time. I will try to do it in smaller batches but obviously at some point it will reaches the limit where it is not worth the struggle with manually divide lists and run in small batches, then close the transacion by closing dynamo then reopen the do it again and so on… then maybe I will just give it to a draftman to do it in a day.

As for the closestpointto, that is a very good tip, thanks. However I think in my case it is a bit more complicated, this is a building where not all the rooms have facade, there are interior corridors, janitor rooms, etc. I dont have a good way to filter these out as there is no parameter for perimeter and interior room.
The elements I want to write the room number into are mainly windows, curtain panels, generic models. All on the facade. So I figured out if I enlarge the room solid in X and Y direction by 1.2 factor they are sticking out of the building and I intersect the points and the solids. This way the interior rooms will not have any match and they are filtered out.

This is how I did the intersect:

Unioning the room solids into one solid will resolve that problem. :slight_smile:

Most of the time both Element.Geometry and Element.Solids fail in terms of dealing with Rooms. I have never had a case of simply getting the geometry of a long list of rooms. Always some of them fail, no matter what. Trying to get room’s curves, create polycurves from them, patch, etc. also fails for at least some of the rooms in a model, no matter what. From my experience, Dynamo simply is not realiable when dealing with rooms’ geometry.

@daninet90 my workaround is to get only starting points from the curves, then create polycurves from them. Afterwards, using those curves, you can create the solids:

that’s the only way I have found for Dynamo not to fail when dealing with Rooms’ geometry :slight_smile:


nice one, thank you

1 Like

Doing something similar (trying to create geometry of rooms in order to do intersections with other geometry). Your suggestion @danail.momchilov works pretty well, it removes most errors in the test-files I have. But one room is still not possible to create lines from. I’m guessing it has to do with some parts of walls sticking into the room. Have you dealt with something similar for these kinds of edge-case rooms?

The last pic shows the lines I get from Room.FinishBoundary. The columns can be handled no problem so I’m guessing it is the little pieces of wall sticking out.

1 Like

So I kept experimenting and just for reference in case anyone else has similar issues, it looks like intersecting room boundaries is the issue. Adding separators solved the issue

1 Like

Hi there! I would suggest this is the cause as well, but I would need to experiment. If you could send the file, I can try to find a solution. Or you could also try to recreate the issue in a sample file

nice find, thank you. :+1: I’m still not sure what is the best practice when you have ton of these errors with a lots of rooms. Definitely not going one-by-one and fixing them. I guess this is something that will never be fixed in the API and we have to live with it.

1 Like

Sadly @danail.momchilov I don’t have the rights to share the Revit file. But the snippet of code looks like this:

I created an output for error-rooms so that the user at least gets a notification of it going awry.

The list of rooms which fail is also a good output in cases like this. Better yet: add them to a new selection set or set a parameter and generate a filtered schedule.

Great points! Thanks @jacob.small

@Extrawurst hi, there’s a package that might be useful for your case, it’s called DynaBIMToolbox - it’s focused on nodes that perform certain geometric and boolean operations directly in the Revit API, so it makes it all much easier and with less room for error. Here are a few nodes you might find helpful:

RoomSurface - you can get the room surface directly as an API PlanarFace:

RevitAPIExtrusionFromPlanarFace - it takes the planar faces and generates DB.Solids, based on a height input:

DoSolidsIntersect - just like the OOTB node, but for RevitAPI Solids:

There are also nodes that extract a wall’s geometry as DB.Solid, etc. Depending on your use case, they might work for you