When trying to create a filter to filter out all rooms without an area, I am getting an error “Failed to found parameter ‘Area’ in Revit document.” Why would this be the case as there are rooms in the model? Using Revit 2022 and the latest RIR v1.5 RC4.
@ehsan - may be able to address why the RoomArea Parameter is not actually a value. I suspect that element has its area value stored in another place.
But, is this what you are trying to do as covered in this Spatial element Analysis? Python component? Analyze Spatial Element . If that is the correct component, we can probably get it updated to a non-python component.
Seems like we have found a new Revit API bug/feature(?). We are using DB.TableView.GetAvailableParameters() to collect valid parameters for a specific category, in this example Rooms. But Revit API apparently does not return the calulated and builtin DB.BuiltInParameter.ROOM_AREA so the filter component complains that it can not find the parameter.
If you run the python script below, you’ll get a list of paramers for Room category using the API mentioned above that is missing Area
from System import Enum
def get_enum_value(enum_type, value):
"""Return enum value matching given value string (case insensitive)"""
for ftype in Enum.GetValues(enum_type):
if int(ftype) == value:
return ftype
for c in doc.Settings.Categories:
if c.Name == "Rooms":
break
for p in DB.TableView.GetAvailableParameters(doc, c.Id):
pe = doc.GetElement(p)
if pe:
print(pe.Name)
else:
print(get_enum_value(DB.BuiltInParameter, p.IntegerValue))
Example result on two of my models:
ALL_MODEL_IMAGE
IFC_GUID
ALL_MODEL_INSTANCE_COMMENTS
ROOM_LOWER_OFFSET
ROOM_UPPER_OFFSET
ROOM_UPPER_LEVEL
ROOM_VOLUME
ROOM_HEIGHT
ROOM_LEVEL_ID
ROOM_OCCUPANCY
ROOM_DEPARTMENT
ROOM_FINISH_BASE
ROOM_FINISH_CEILING
ROOM_FINISH_WALL
ROOM_FINISH_FLOOR
ROOM_NUMBER
ROOM_NAME
# Room North Finish
# Room South Finish
# Room East Finish
# Room West Finish
# Room Cabinets
# Room Counters
@eirannejad@scottd thanks for looking into this. As I mentioned, this method worked in Revit 2021 and RIR v1.5 RC2. Has then been a Revit API change or is this coming from the newer RIR version? Looking at the two components between v1.5 RC2 and RC4 they do appear different (but both now failing in RC4)…