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

Revision history [back]

click to hide/show revision 1
initial version

Setting SHGC in OpenStudio

I am trying to set the SHGC(Solar Heat Gain Coefficient) in OpenStudio for a Fixed Window under the category Simple Glazing System Window Materials using a ruby measure. I am using OpenStudio 1.6.0 and there is no method to set the SHGC using ruby that I can find. The only other way I have found to set SHGC is by translating the whole model to EnergyPlus, setting SHGC and bring it back to OpenStudio. The code for that method looks like this:

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
workspace = ft.translateModel(model)
win = model.getObjectsByType("WindowMaterial:SimpleGlazingSystem".to_IddObjectType)
win[0].setDouble(2,shgc) 
bt = OpenStudio::EnergyPlus::ReverseTranslator.new
model = bt.translateWorkspace(workspace)

Unfortunately the above code seems to work in the cmd but the changes do not show up in OpenStudio. What should I try next to set the SHGC?

Setting SHGC in OpenStudio

I am trying to set the SHGC(Solar Heat Gain Coefficient) in OpenStudio for a Fixed Window under the category Simple Glazing System Window Materials using a ruby measure. I am using OpenStudio 1.6.0 and there is no method to set the SHGC using ruby that I can find. The only other way I have found to set SHGC is by translating the whole model to EnergyPlus, setting SHGC and bring it back to OpenStudio. The code for that method looks like this:

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
workspace = ft.translateModel(model)
win = model.getObjectsByType("WindowMaterial:SimpleGlazingSystem".to_IddObjectType)
win[0].setDouble(2,shgc) 
bt = OpenStudio::EnergyPlus::ReverseTranslator.new
model = bt.translateWorkspace(workspace)

Unfortunately the above code seems to work in the cmd but the changes do not show up in OpenStudio. What should I try next to set the SHGC?