Rooms name in pyRevit form

Hi All,

I’m collecting rooms and I’d like their name displayed in a pyRevit form but the name_attr gives me an error. I’m not sure if there is another way. Do I need to get the rooms name manually ?

mycode

from pyrevit import forms
from Autodesk.Revit.DB import *

doc = __revit__.ActiveUIDocument.Document

rooms = FilteredElementCollector(doc)\
.WherePasses(Architecture.RoomFilter())\
.ToElements()

	
res = forms.SelectFromList.show(rooms,
                                multiselect=True,
                                name_attr='Name',
                                button_name='Select Room')

print (res)

You might have to use

room.LookupParameter("Room Name")

to access the Room Name parameter

2 Likes