Finding Room Centerlines

Hi All,
Does anyone have advice for creating a dynamo script that will find room center lines. So often in custom residential we align to the centerline of rooms. It would be a huge time saver to have a script that finds this as opposed to running custom dimension strings in every room.



what do you mean by centerlines? Please show some examples of expected result. Please show some work.

If you’re referring to room center points, try doing a search on the forum. You should be able to arrive to a few examples of this:

3rd search result:

What I’m referring to is the center line axis of a room. It can get tricky
with multiple jogs and curved walls, however its best to start with a
simple 4 sided room.

Hi @njacobson

Out of curiosity why do you need those centrelines. What is your end goal?

I’m working on a high end residential projects (20,000 sq.ft.). Every room
has multiple elements centered. It would save time to have this alignment
and snap elements (windows, doors, furniture, toilets, etc.). We start
these alignments at very early stages in design and typically go through
multiple iterations. Increasingly we are getting projects that require such
alignments. Make sense?

So you want to be able to snap your elements to these center lines while positioning them?
You could create a generic model family with two perpendicular lines joining in the origin and place them in the room center points, so that you will be able to snap your elements to these family’s lines. Once you’re done you can cancel them

1 Like

Good use of the existing script already described. Yeah that would work.

I know it’s more work, but I’d recommend reference planes with equality constraints so that when the room changes, the plane changes as well. The Dynamo solution will most likely be a one-time only solution.

yes I’ve been using reference plans with the equality constraint. However
with over a 100 rooms this can be time consuming. I’ve found dynamo to be
problematic with other such operations that did not update dynamically.

We use revit as a design tool, for better or worse, and so many things get
jockeyed around with heavy client involvement even in later stages. So I’m
rally looking for something flexible and automated. I can get what I want
in Grasshopper, perhaps looking into the Grasshopper/dynamo relationship is
the best way to go.

Not saying it can’t be done but I think you’d want something more flexible.

How about this; use Dynamo to create Scope Boxes around each room (Wait, can we create SBs with Dynamo?), find the midpoints to create named reference planes that are assigned to the scope box you just created. Now you just need to add the equality constraint and tweak in the model.

@njacobson There is a custom node from Lunchbox package called “Room.Collector” use that to get center point of rooms and extract that points to excel to keep a record of the rooms location so that if the room changes you can easily differentiate between old and new location.

Hi @Greg_McDowell

Yes we can.

i don’t think there is API for ScopeBoxes @Kulkul.

I see. Well once you get a point in the room you like, you could try something along the lines of this to create your planes in Revit:

1 Like

@Dimitar_Venkov Will this work if there are more than 4 sides of rooms?

How about finding the bounding box of the Room to determine the extents of the Reference Plane?

Too bad about Scope Boxes. Can we control the 3D extents of Reference Planes (horizontally and vertically) from within Dynamo or the API?

Yes this would be a critical addition. Otherwise we would have lines
everywhere or not reaching far enough to align windows and doors.

There is a problem with the room center for rooms that are not symmetrical.
Say there is a bump out… this skews the result. Perhaps there needs to me
a selection of only the 4 longest walls to base this off…


This type of problem is one which can result in so many possibilities, that it can become counter-productive to do computationally. Assuming 90% can be solved in a cost-effective amount of time, there will always be exceptions that break the rules - for example, if you have a radial room with more than four sides? How do you define what passes as a ‘bump’ and what is treated beyond a ‘bump’? The question is how much ‘automation’ are you after. Any good programmer will tell you that a robust system should output consistent results and require minimal maintenance.

One recommendation I would make to avoid a seemingly simple ambition snowballing into one overly-complex problem that takes more time to solve than it saves, is to add a proxy object manually in each room defining its extents as a four sided object. This is very easy for the human brain to do, but pattern recognition is notoriously difficult for a program to do (CAPTCHA problem). Its far from perfect, but at least keeps things achievable and realistic without entering into PHD territory.

You can use this object (filled region etc) to define the centre point and extents of each of your rooms - plus anyone in your team has the ability to make quick and easy changes without having to delve into the inner workings of a dynamo script.