First time here? Check out the Help page!
1 | initial version |
Here's the code I've used to get the HVAC components associated with a ZoneHVAC object.
# get equipment and components
ptac = eqpt.to_ZoneHVACPackagedTerminalAirConditioner.get
if ptac.supplyAirFan.to_FanOnOff.is_initialized
fan = ptac.supplyAirFan.to_FanOnOff.get
elsif ptac.supplyAirFan.to_FanConstantVolume.is_initialized
fan = ptac.supplyAirFan.to_FanConstantVolume.get
end
This is used in a measure to Rename Zone HVAC Equipment And Components available in my OpenStudio Measures repository.
# rename equipment
if rename_hvac_eqpt == true
ptac.setName("#{z.name} PTAC")
count_eqpt += 1
end
# rename components
if rename_hvac_comp == true
fan.setName("#{ptac.name} Fan")
count_fans += 1
htg_coil.setName("#{ptac.name} Htg Coil")
count_htg_coils += 1
clg_coil.setName("#{ptac.name} Clg Coil")
count_clg_coils += 1
end