lib/to_openstudio/construction/windowshade.rb in honeybee-openstudio-2.16.5 vs lib/to_openstudio/construction/windowshade.rb in honeybee-openstudio-2.16.6

- old
+ new

@@ -60,11 +60,15 @@ @shade_construction = OpenStudio::Model::Construction.new(openstudio_model) @shade_construction.setName(shd_id) # create the layers of the unshaded construction into which we will insert the shade os_materials = [] - @hash[:window_construction][:layers].each do |layer| - material_identifier = layer + if @hash.key?(:layers) + mat_key = :layers + else + mat_key = :materials + end + @hash[:window_construction][mat_key].each do |material_identifier| material = openstudio_model.getMaterialByName(material_identifier) unless material.empty? os_material = material.get os_materials << os_material end