lib/from_honeybee/construction/windowshade.rb in honeybee-openstudio-2.3.1 vs lib/from_honeybee/construction/windowshade.rb in honeybee-openstudio-2.3.2

- old
+ new

@@ -95,13 +95,14 @@ # insert the shade material shd_mat_name = openstudio_model.getMaterialByName(@hash[:shade_material]) unless shd_mat_name.empty? @shade_material = shd_mat_name.get + obj_type = @shade_material.iddObject.name end unless @shade_material.nil? - if @shade_material.is_a? OpenStudio::Model::StandardGlazing + if obj_type == 'OS:WindowMaterial:StandardGlazing' if @shade_location == 'Interior' os_materials[-1] = @shade_material elsif @shade_location == 'Exterior' | os_materials.length < 2 os_materials[0] = @shade_material else # middle glass pane @@ -157,12 +158,15 @@ def to_openstudio_shading_control(openstudio_model) # add a WindowShadingControl object to a model for a given aperture and room os_shade_control = OpenStudio::Model::ShadingControl.new(@shade_construction) # figure out the shading type - if @shade_material.is_a? OpenStudio::Model::StandardGlazing + unless @shade_material.nil? + obj_type = @shade_material.iddObject.name + end + if obj_type == 'OS:WindowMaterial:StandardGlazing' shd_type = 'SwitchableGlazing' - elsif @shade_material.is_a? OpenStudio::Model::Blind + elsif obj_type == 'OS:WindowMaterial:Blind' if @shade_location == 'Between' shd_type = 'BetweenGlassBlind' else shd_type = @shade_location + 'Blind' end