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

Revision history [back]

If you want to manipulate code in IDF, then you meed to make an EnergyPlus measure, which takes in and returns an IDF file vs. an OSM.

But you can edit and create simple glazing objects in OpenStudio.

# create construction and material and link them together
construction = OpenStudio::Model::Construction.new(model)
material = OpenStudio::Model::SimpleGlazing.new(model)

# add material to construction
construction.insertLayer(0,material)

# set material properties
material.setUFactor(options["uFactor"])
material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
material.setVisibleTransmittance(options["visibleTransmittance"])

If you want to manipulate code in IDF, then you meed to make an EnergyPlus measure, which takes in and returns an IDF file vs. an OSM.

But you can edit and create simple glazing objects in OpenStudio.

# create construction and material and link them together
construction = OpenStudio::Model::Construction.new(model)
material = OpenStudio::Model::SimpleGlazing.new(model)

# add material to construction
construction.insertLayer(0,material)

# set material properties
material.setUFactor(options["uFactor"])
material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
material.setVisibleTransmittance(options["visibleTransmittance"])

If you are have a material that you want to model you need to do something like this.

if material.to_SimpleGlazing.is_initialized
  material = material.to_SimpleGlazing.get
  material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
end

If you want to manipulate code in IDF, then you meed to make an EnergyPlus measure, which takes in and returns an IDF file vs. an OSM.

But you can edit and create simple glazing objects in OpenStudio.

# create construction and material and link them together
construction = OpenStudio::Model::Construction.new(model)
material = OpenStudio::Model::SimpleGlazing.new(model)

# add material to construction
construction.insertLayer(0,material)

# set material properties
material.setUFactor(options["uFactor"])
material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
material.setVisibleTransmittance(options["visibleTransmittance"])

If you are have a material already in the model that you want to model alter you need to do something like this.

if material.to_SimpleGlazing.is_initialized
  material = material.to_SimpleGlazing.get
  material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
end