# Define the field paths for the desired parameters, use the Speckle 3D Viewer to inspect the structure of the properties and adjust paths as needed.
# Select one of the rooms in the viewer, inspect its properties and find the path to the parameters you want to extract.
# The path is a list of keys to navigate through the nested dictionaries in obj.properties. For example, if the parameter is located at obj.properties['Parameters']['Instance Parameters']['Identity Data']['Number'],
# then the path would be ['Parameters', 'Instance Parameters', 'Identity Data', 'Number'].
field_paths = {
'Number': ['Parameters', 'Instance Parameters', 'Identity Data', 'Number'],
'Name': ['Parameters', 'Instance Parameters', 'Identity Data', 'Name'],
'Occupant': ['Parameters', 'Instance Parameters', 'Identity Data', 'Occupant'],
'Floor Finish': ['Parameters', 'Instance Parameters', 'Identity Data', 'Floor Finish'],
'Level': ['Parameters', 'Instance Parameters', 'Constraints', 'Level'],
'Area': ['Parameters', 'Instance Parameters', 'Dimensions', 'Area'],
'Volume': ['Parameters', 'Instance Parameters', 'Dimensions', 'Volume'],
'Perimeter': ['Parameters', 'Instance Parameters', 'Dimensions', 'Perimeter'],
'Unbounded Height': ['Parameters', 'Instance Parameters', 'Dimensions', 'Unbounded Height'],
}
room_data = filter_objects_by_category(all_objects, ['Rooms']) # Make sure to extract only rooms
data = extract_object_data(room_data, field_paths) # Extract the data using the defined field paths
df_rooms = pd.DataFrame(data)
df_rooms.head()