Working with room data

How to access the room data of rooms in the real model

The “room data” here refers to the VERoomData class which allows access to information about a room and also methods to make changes to the room. These are accessed using the get_room_data() method of the VEBody class.

The code below uses a Python dictionary comprehension statement to create a Python dictionary roombodies_room_data_dict to hold the VERoomData instances for all rooms.

import iesve
import os
import iesve
currentproject = iesve.VEProject.get_current_project()
realmodel = currentproject.models[0]
bodies = realmodel.get_bodies(False)  # SelectedOnly = False; used to select all bodies in the model.
roombodies = [x for x in bodies if x.type == iesve.VEBody_type.room]  # iesve.VEBody_type.room has an integer value of 1.
roombodies_room_data_dict = {body.id: body.get_room_data() for body in bodies}

How to access the room general information for all rooms

This code uses the get_general() method of the VERoomData class to access the general information about a room such as its name, area and volume.

import iesve
import os
import iesve
currentproject = iesve.VEProject.get_current_project()
realmodel = currentproject.models[0]
bodies = realmodel.get_bodies(False)  # SelectedOnly = False; used to select all bodies in the model.
roombodies = [x for x in bodies if x.type == iesve.VEBody_type.room]  # iesve.VEBody_type.room has an integer value of 1.
roombodies_room_data_dict = {body.id: body.get_room_data(type = iesve.attribute_type.real_attributes) for body in bodies}
roombodies_room_data_general_dict = {body_id: room_data.get_general() for body_id, room_data in roombodies_room_data_dict.items()}

An example of a iesve.VERoomData.get_general() return value is:

{
   'name': 'ROOF',
   'general_template': 1,
   'general_template_name': 'default',
   'thermal_template': 4,
   'thermal_template_name': 'Void',
   'id': 'RF000000',
   'volume': 714.7855251355139,
   'facade_area': 0.0,
   'floor_area': 0.0,
   'included_in_building_floor_area': True,
   'included_in_building_floor_area_from_template': True,
   'lettable_perc': 100,
   'lettable_perc_from_template': True,
   'circ_perc': 0,
   'circ_perc_from_template': True
}

How to access the room conditions information for all rooms

This code uses the get_room_conditions() method of the VERoomData class to access the general information about a room such as its name, area and volume.

import iesve
import os
import iesve
currentproject = iesve.VEProject.get_current_project()
realmodel = currentproject.models[0]
bodies = realmodel.get_bodies(False)  # SelectedOnly = False; used to select all bodies in the model.
roombodies = [x for x in bodies if x.type == iesve.VEBody_type.room]  # iesve.VEBody_type.room has an integer value of 1.
roombodies_room_data_dict = {body.id: body.get_room_data(type = iesve.attribute_type.real_attributes) for body in bodies}
roombodies_room_data_room_conditions_dict = {body_id: room_data.get_room_conditions() for body_id, room_data in roombodies_room_data_dict.items()}

An example of a iesve.VERoomData.get_room_conditions() return value is:

{
   'cooling_profile': 'ON',
   'cooling_profile_from_template': True,
   'cooling_setpoint': 23.0,
   'cooling_setpoint_constant': True,
   'cooling_setpoint_from_template': True,
   'cooling_setpoint_profile': '-',
   'cooling_setpoint_type': iesve.setpoint_type.constant,
   'dhw': 0.0,
   'dhw_from_template': True,
   'dhw_linked_to_occupancy': True,
   'dhw_linked_to_occupancy_from_template': True,
   'dhw_profile': '-',
   'dhw_profile_from_template': '-',
   'dhw_room_level_setting': 1,
   'dhw_room_level_setting_from_template': 1,
   'dhw_unit': 'l/(h·pers)',
   'dhw_unit_val': 0,
   'furniture_mass_factor': 1.0,
   'furniture_mass_factor_from_template': True,
   'heating_profile': 'ON',
   'heating_profile_from_template': True,
   'heating_setpoint': 19.0,
   'heating_setpoint_constant': True,
   'heating_setpoint_from_template': True,
   'heating_setpoint_profile': '-',
   'heating_setpoint_twovalue_main_setpoint': '-',
   'heating_setpoint_twovalue_profile': '-',
   'heating_setpoint_twovalue_setback': '-',
   'heating_setpoint_type': iesve.setpoint_type.constant,
   'max_cooling_and_dehumidification': 0.0,
   'max_dehumidification': 0.0,
   'max_heating_and_humidification': 0.0,
   'max_humidification': 0.0,
   'plant_profile': 'ON',
   'plant_profile_from_template': True,
   'plant_profile_type': 0,
   'plant_profile_type_str': 'Set to heating profile',
   'sat_perc_lower': 0.0,
   'sat_perc_lower_from_template': True,
   'sat_perc_upper': 100.0,
   'sat_perc_upper_from_template': True,
   'solar_reflected_fraction': 0.05,
   'solar_reflected_fraction_from_template': True
}