Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

You can edit the objects directly with a ruby script or make your own measure. See the OpenStudio Measure Writing Reference. The measure testing section includes an example of how to execute OpenStudio ruby scripts directly from the Notepad++ text editor in Windows.

A short ruby script looks like this:

path = "C:/Users/name/model_directory/model.osm"
translator = OpenStudio::OSVersion::VersionTranslator.new
ospath = OpenStudio::Path.new(path)
model = translator.loadModel(ospath)
model = model.get

my_schedule = model.getScheduleByName("My Schedule").get

model.getZoneHVACFourPipeFanCoils.each do |unit|
  unit.setAvailabilitySchedule(my_schedule)
  unit.setCapacityControlMethod("CyclingFan")
  #other methods here.  See the ZoneHVACFourPipeFanCoil model object API reference
end

model.save(path,true)