Copying rooms and create room seperation lines, create and label MEP rooms

Im currently facing a few issues, partially I guess because of things I do not know about how Revit handles some data.

I tried to make a small test project that copies the rooms and room lines over into the WIP project, saving time on manually importing it. Turns out the architect model doesnt contain any room seperation lines, so I have to make them from the existing rooms myself:

        # Get the boundaries of the room
        boundary_options = SpatialElementBoundaryOptions()
        boundaries = room.GetBoundarySegments(boundary_options)

        for boundary in boundaries:
            for segment in boundary:
                # Create a line from the segment
                line = segment.GetCurve()
                # Create a new room separation line
                new_line = doc.Create.NewModelCurve(line, SketchPlane.Create(doc, Plane.CreateByNormalAndOrigin(XYZ.BasisZ, line.GetEndPoint(0))))
                new_room_separation_lines.append(new_line)

                # Increment the room separation count for the level
                if level_name in level_names:
                    index = level_names.index(level_name)
                    room_separation_counts[index] += 1

Issue: It seems to create normal lines in the project I want to extract the data from.

Copying (normal) rooms between projects also seems to not be something that is typical for Revit, some said it’s not possible to copy them at all.

After that I would have to create and label MEP rooms. Is that possible as well?

I do not expect too much help, would be cool if you can help me with what revit dynamo can do here

You‘ll want to use this method to create the room separators: NewRoomBoundaryLines Method

Code sample: ClockworkForDynamo/nodes/2.x/python/RoomSeparator.FromCurve.py at master ¡ andydandy74/ClockworkForDynamo ¡ GitHub

1 Like

Hmm, didnt really work

Step one should always be figuring out how Revit handles your process natively. Your automation is going to follow the same rules, so you might as well get that nailed down before you start on the logic. It sounds like you need to do more investigating into Rooms before you look into automating their creation.

Rooms (and Spaces) have to be bound. Separation lines are just bounding lines, but other elements can be boundaries as well: typically walls, floors, and ceilings. If the architectural model doesn’t have any Room Separation Lines, then the Rooms must be bound by elements. Copying Rooms into a document is definitely possible but requires the same boundaries for the elements to “work” properly. You can actually use the bounding elements from a linked model to define the same bounds within your document, leading to copied elements matching exactly. (This is actually standard practice for any projects with Rooms or Spaces.)

Select the link with rooms and toggle Room Bounding to “on” within the Type Properties to use bounding elements from the link.

Start by manually setting everything up in your test project to learn how it all works and ensure that you’re getting the outcome you expect. Once you understand the steps and pieces you need to automate, then you can start working on the Dynamo logic.

1 Like