First time here? Check out the Help page!
1 | initial version |
Here's a snippet I used to do something similar:
# get model and model objects
model = OpenStudio::Model::Model.load(osm_path).get
objs = model.getAirTerminalSingleDuctVAVNoReheats
air_loops = model.getAirLoopHVACs
# do stuff
air_loops.each do |al|
zones = al.thermalZones
zones.each do |z|
al.removeBranchForZone(z)
atu_new = OpenStudio::Model::AirTerminalSingleDuctUncontrolled.new(model, model.alwaysOnDiscreteSchedule)
al.addBranchForZone(z, atu_new.to_StraightComponent)
end
end
2 | No.2 Revision |
Here's a snippet I used to do something similar:
# get model and model objects
model = OpenStudio::Model::Model.load(osm_path).get
objs = model.getAirTerminalSingleDuctVAVNoReheats
air_loops = model.getAirLoopHVACs
# do stuff
air_loops.each do |al|
zones = al.thermalZones
zones.each do |z|
al.removeBranchForZone(z)
atu_new = OpenStudio::Model::AirTerminalSingleDuctUncontrolled.new(model, model.alwaysOnDiscreteSchedule)
al.addBranchForZone(z, atu_new.to_StraightComponent)
end
end
3 | No.3 Revision |
Here's Here are a snippet I couple snippets I've used to do something similar:
# get model and model objects
model = OpenStudio::Model::Model.load(osm_path).get
objs = model.getAirTerminalSingleDuctVAVNoReheats
air_loops = model.getAirLoopHVACs
# do stuff
air_loops.each do |al|
zones = al.thermalZones
zones.each do |z|
al.removeBranchForZone(z)
atu_new = OpenStudio::Model::AirTerminalSingleDuctUncontrolled.new(model, model.alwaysOnDiscreteSchedule)
al.addBranchForZone(z, atu_new.to_StraightComponent)
end
end
model.getThermalZones.each do |z|
zone_eqpt = z.equipment #vector
zone_eqpt.each do |eqpt|
if eqpt.to_AirTerminalSingleDuctUncontrolled.is_initialized
atu_old = eqpt.to_AirTerminalSingleDuctUncontrolled.get
atu_old.remove
atu_new = OpenStudio::Model::AirTerminalSingleDuctVAVNoReheat.new(model)
end
end
end