lib/to_openstudio/hvac/template.rb in honeybee-openstudio-2.29.1 vs lib/to_openstudio/hvac/template.rb in honeybee-openstudio-2.29.2
- old
+ new
@@ -83,10 +83,14 @@
os_hvac = openstudio_model.add_cbecs_hvac_system(standard, equipment_type, zones)
os_air_loop = nil
air_loops = openstudio_model.getAirLoopHVACs
unless air_loops.length == $air_loop_count # check if any new loops were added
$air_loop_count = air_loops.length
- os_air_terminal = zones[0].airLoopHVACTerminal
+ os_air_terminal = []
+ zones.each do |zon|
+ os_air_terminal = zon.airLoopHVACTerminal
+ break if !os_air_terminal.empty?
+ end
unless os_air_terminal.empty?
os_air_terminal = os_air_terminal.get
os_air_loop_opt = os_air_terminal.airLoopHVAC
unless os_air_loop_opt.empty?
os_air_loop = os_air_loop_opt.get