lib/to_openstudio/model.rb in honeybee-openstudio-2.28.0 vs lib/to_openstudio/model.rb in honeybee-openstudio-2.28.1

- old
+ new

@@ -201,10 +201,13 @@ if log_report puts 'Translating Context Shade Geometry' end create_orphaned_shades + create_orphaned_faces + create_orphaned_apertures + create_orphaned_doors end def create_materials(material_dicts, check_existing=false) material_dicts.each do |material| # check if there's already a material in the model with the identifier @@ -586,31 +589,46 @@ def create_orphaned_shades if @hash[:orphaned_shades] shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model) shading_surface_group.setShadingSurfaceType('Building') @hash[:orphaned_shades].each do |shade| - shade_object = Shade.new(shade) - openstudio_shade = shade_object.to_openstudio(@openstudio_model) - openstudio_shade.setShadingSurfaceGroup(shading_surface_group) + shade_object = Shade.new(shade) + openstudio_shade = shade_object.to_openstudio(@openstudio_model) + openstudio_shade.setShadingSurfaceGroup(shading_surface_group) end end end def create_orphaned_faces if @hash[:orphaned_faces] - raise "Orphaned Faces are not translatable to OpenStudio." + shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model) + shading_surface_group.setShadingSurfaceType('Building') + @hash[:orphaned_faces].each do |face| + face_object = Face.new(face) + openstudio_shade = face_object.to_openstudio_shade(@openstudio_model, shading_surface_group) + end end end def create_orphaned_apertures if @hash[:orphaned_apertures] - raise "Orphaned Apertures are not translatable to OpenStudio." + shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model) + shading_surface_group.setShadingSurfaceType('Building') + @hash[:orphaned_apertures].each do |ap| + ap_object = Aperture.new(ap) + openstudio_shade = ap_object.to_openstudio_shade(@openstudio_model, shading_surface_group) + end end end def create_orphaned_doors if @hash[:orphaned_doors] - raise "Orphaned Doors are not translatable to OpenStudio." + shading_surface_group = OpenStudio::Model::ShadingSurfaceGroup.new(@openstudio_model) + shading_surface_group.setShadingSurfaceType('Building') + @hash[:orphaned_doors].each do |dr| + dr_object = Door.new(dr) + openstudio_shade = dr_object.to_openstudio_shade(@openstudio_model, shading_surface_group) + end end end #TODO: create runlog for errors.