Get "name" and "area" of FromRoom

Hi everyone!

I’m new API,
I tried get “name” and “area” of FromRoom but result don’t correct.

“Room Name” contain room number and “Area” not round all element.
Please show me where is incorrect code.
Thank Advance!

import Autodesk
from Autodesk.Revit.DB import *

doc = revit.ActiveUIDocument.Document
uidoc = revit.ActiveUIDocument

def get_from_room_name(element):
return Autodesk.Revit.DB.Element.Name.get(element.FromRoom[phase])
return None

def get_from_room_area(element):
return round(((element.FromRoom[phase].Area)*0.092903),2)

phases = doc.Phases
phase = phases[phases.Size - 1]

#Select all elements category from revit
selection = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Doors).WhereElementIsNotElementType().ToElements()

#get From_Room_Name
room_name = []
for i in selection:
for i in room_name:

#get From_Room_Area
room_area = []
for i in selection:


Hi, maybe try to change room name with basics python functions (Python Remove Character from String: A Guide | Career Karma) and the same with room area (Python round() Function)?


You might have to use

room.LookupParameter("Room Name")

to access the Room Name parameter. Accessing the area parameter is similar, just use “Area” I think.

I hope this helps! If you’re still having trouble tomorrow I can post some code from a Room Manager script I wrote.