lib/from_openstudio/model.rb in honeybee-openstudio-2.20.9 vs lib/from_openstudio/model.rb in honeybee-openstudio-2.21.0

- old
+ new

@@ -43,10 +43,11 @@ require 'from_openstudio/material/window_gas_mixture' require 'from_openstudio/construction/air' require 'from_openstudio/construction/opaque' require 'from_openstudio/construction/window' require 'from_openstudio/construction/shade' +require 'from_openstudio/construction_set' require 'openstudio' module Honeybee class Model @@ -63,10 +64,11 @@ # Hashes for all constructions in the model $opaque_constructions = {} $window_constructions = {} $shade_constructions = {} + hash[:properties] = properties_from_model(openstudio_model) rooms = rooms_from_model(openstudio_model) hash[:rooms] = rooms if !rooms.empty? @@ -125,11 +127,13 @@ hash = {} hash[:type] = 'ModelEnergyProperties' hash[:constructions] = [] hash[:constructions] = constructions_from_model(openstudio_model) hash[:materials] = materials_from_model(openstudio_model) - + hash[:construction_sets] = [] + hash[:construction_sets] = constructionsets_from_model(openstudio_model) + hash end def self.rooms_from_model(openstudio_model) result = [] @@ -237,9 +241,22 @@ end result end + # Create HB ConstructionSets from OpenStudio Construction Set + def self.constructionsets_from_model(openstudio_model) + result = [] + + openstudio_model.getDefaultConstructionSets.each do |construction_set| + if construction_set.nameString != "Default Generic Construction Set" + result << ConstructionSetAbridged.from_construction_set(construction_set) + end + end + + result + end + def self.shade_constructions_from_model(shade_constructions) result = [] shade_constructions.each do |key, value| result << ShadeConstruction.from_construction(value)