I’m not finding a way to move a group of rooms in model editor. Is there a way? If not, I think this would be a useful feature.
I’m using the Revit plugin on a medical office building project that has a couple of linked models with the interior walls and rooms for special clinic modules on each of two floors. Since pollination can’t import rooms from a linked model, I found the easiest way is to export the rooms from each of the two models. The Revit models do not have the correct coordinates, and I’m not sure how to adjust these properly. It would be very easy to select all the rooms and use a “move” command to drag them into the right spot within the main model.
If anybody has a way to move the imported rooms in ModelEditor, please share!
For now, I’ll try to figure out how to adjust the origin in the Revit models..
We don’t have a functionality to support moving the rooms in the UI. I can see how it will be useful for the scenario that you are trying to resolve. Technically, we can support moving the rooms. Let me document this for @chriswmackey and @antonellodinunzio and get back to you. The challenge is that it will affect other workflows like the one for adding windows. We probably need to keep track of the moving vector for each room to be able to make this feasible in the new version of the Revit plugin.
Meanwhile, if you send me the PoMF, I can move the rooms for you to the desired location and send you back the updated version so you can continue your work.
After way too much trial and error in Revit, I was able to work out a Python script in the ModelEditor environment that did the trick. I’ll share it below, but note that I iterated through this with Claude, and I didn’t write or review it too closely. Use at your own risk!
"""
Translate all geometry in the model by an offset vector.
Uses model.move() instead of individual room moves,
and respects the model's native unit system.
"""
from model_editor import Editor
from ladybug_geometry.geometry3d.pointvector import Vector3D
editor = Editor()
model = editor.model
# --- Check units ---
units = editor.units
print(f"Model units: {units}")
print(f"Total room_2ds: {len(model.room_2ds)}")
# --- Define offset in FEET ---
OFFSET_X_FT = -75.5
OFFSET_Y_FT = -13.5
OFFSET_Z_FT = 0.0
# --- Convert to model units ---
FT_TO_M = 0.3048
if units == 'Feet':
vec = Vector3D(OFFSET_X_FT, OFFSET_Y_FT, OFFSET_Z_FT)
print("Using feet directly (no conversion)")
elif units == 'Meters':
vec = Vector3D(OFFSET_X_FT * FT_TO_M, OFFSET_Y_FT * FT_TO_M, OFFSET_Z_FT)
print("Converted feet to meters")
elif units == 'Inches':
vec = Vector3D(OFFSET_X_FT * 12, OFFSET_Y_FT * 12, OFFSET_Z_FT * 12)
print("Converted feet to inches")
else:
print(f"WARNING: Unexpected units '{units}' - defaulting to feet")
vec = Vector3D(OFFSET_X_FT, OFFSET_Y_FT, OFFSET_Z_FT)
print(f"Move vector: ({vec.x:.4f}, {vec.y:.4f}, {vec.z:.4f}) {units}")
# --- Capture BEFORE state ---
test = model.room_2ds[0]
v_before = test.floor_geometry.vertices[0]
print(f"\nBEFORE - {test.display_name} vertex 0: ({v_before.x:.4f}, {v_before.y:.4f})")
# --- Move entire model (not individual rooms) ---
model.move(vec)
# --- Verify AFTER state ---
v_after = test.floor_geometry.vertices[0]
print(f"AFTER - {test.display_name} vertex 0: ({v_after.x:.4f}, {v_after.y:.4f})")
dx = v_after.x - v_before.x
dy = v_after.y - v_before.y
print(f"Delta: ({dx:.4f}, {dy:.4f})")
# --- Update editor ---
editor.update()
print("\neditor.update() called")
# --- Verify persistence ---
model2 = editor.model
v_check = model2.room_2ds[0].floor_geometry.vertices[0]
print(f"POST-UPDATE vertex 0: ({v_check.x:.4f}, {v_check.y:.4f})")
if abs(v_check.x - v_before.x) < 0.01:
print("\n** WARNING: update() may have reset the model **")
else:
print("\n** Move appears to have persisted **")
print("Check the viewer. If still no visual change,")
print("try: File > Save, close, and reopen the file.")
editor.update()
I was just going to say that it’s possible to move the rooms with the script editor. I guess the SDK Documentation for Dragonfly is good enough that Claude was able to figure out how to use it.
Granted, a lot of the script is not critical but just giving you extra information. This is all that you really need to move a set of selected rooms given offset values for XYZ:
from model_editor import Editor
from ladybug_geometry.geometry3d.pointvector import Vector3D
editor = Editor()
# --- Define offset in Model Units---
OFFSET_X = -75.5
OFFSET_Y = -13.5
OFFSET_Z = 0.0
move_vec = Vector3D(OFFSET_X , OFFSET_Y, OFFSET_Z)
# --- Move the selected rooms ---
for room in editor.selected_room_2ds:
room.move(vec)
editor.update()
FWIW, It didn’t work on the first few iterations so we added some extra validation steps. It ended up just being that it needed editor.update() at the end, which is what the little helpful popup told me.. But this concise version is much nicer. Saved in my script library!