from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import UIDocument, UIApplication
uidoc = __revit__.ActiveUIDocument
doc = __revit__.ActiveUIDocument.Document
app = __revit__.Application
all_phases = list(doc.Phases)
phase = all_phases[-1]
all_furniture = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Furniture).WhereElementIsNotElementType().ToElements()
all_f_systems = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_FurnitureSystems).WhereElementIsNotElementType().ToElements()
all_plumbing = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PlumbingFixtures).WhereElementIsNotElementType().ToElements()
all_elements = list(all_furniture) + list(all_f_systems) + list(all_plumbing)
t = Transaction(doc, __title__)
t.Start()
for el in all_elements:
room = el.Room[phase]
if room:
room_name = room.get_Parameter(BuiltInParameter.ROOM_NAME).AsString()
room_number = room.Number
p_room_name = el.LookupParameter('Room Name')
p_room_number = el.LookupParameter('Room Number')
if p_room_name:
p_room_name.Set(room_name)
if p_room_number:
p_room_number.Set(room_number)
t.Commit()