openstudiocore/sketchup_plugin/openstudio/sketchup_plugin/user_scripts/On Demand Template Generators/resources/SpaceTypeGenerator.rb
# pass in a specific climate zone here and get the climate zone set to use for generate_construction_set
pass in a specific climate zone here and get the climate zone set to use for generate_construction_set
pass in a specific climate zone here and get the climate zone set to use for generate_construction_set
def find_climate_zone_set(template, clim, building_type, spc_type)
  possible_climate_zone_sets = []
  if tmp1 = @spc_types[template]
    tmp1.each_pair do |climate_zone_set, tmp2|
      if tmp3 = tmp2[building_type]
        if data = tmp3[spc_type]
          possible_climate_zone_sets << climate_zone_set
        end
      end
    end
  end
  result = nil
  possible_climate_zone_sets.each do |possible_climate_zone_set|
    if climate_zone_set = @climate_zone_sets[possible_climate_zone_set]
      if climate_zones = climate_zone_set['climate_zones']
        if climate_zones.include?(clim)
          if not result
            result = possible_climate_zone_set
          else
            puts "Error, climate zone contained in multiple climate zone sets"
          end
        end
      end
    end
  end
  return result
end
def find_climate_zone_set ( template , clim , building_type , spc_type ) possible_climate_zone_sets = [ ] if tmp1 = @spc_types [ template ] tmp1 . each_pair do | climate_zone_set , tmp2 | if tmp3 = tmp2 [ building_type ] if data = tmp3 [ spc_type ] possible_climate_zone_sets << climate_zone_set end end end end result = nil possible_climate_zone_sets . each do | possible_climate_zone_set | if climate_zone_set = @climate_zone_sets [ possible_climate_zone_set ] if climate_zones = climate_zone_set [ 'climate_zones' ] if climate_zones . include? ( clim ) if not result result = possible_climate_zone_set else puts "Error, climate zone contained in multiple climate zone sets" end end end end end return result end
pass in a specific climate zone here and get the climate zone set to use for generate_construction_set
pass in a specific climate zone here and get the climate zone set to use for generate_construction_set
template
<not_specific>
clim
<not_specific>
building_type
<not_specific>
spc_type
<not_specific>