Skip to content

Commit

Permalink
fix(windowshade): Use better handling of WindowConstructionShade ID
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jul 12, 2023
1 parent 3dceb9e commit 462b3ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/to_openstudio/construction/windowshade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,20 @@ def find_existing_openstudio_object(openstudio_model)
end

def to_openstudio(openstudio_model)
# write the shaded and unsaded versions of the construction into the model
# reverse the shaded and unshaded identifiers so unshaded one is assigned to apertures
# set the unshaded ID to be the whole construction ID so unshaded one is assigned to apertures
unshd_id = @hash[:identifier]
shd_id = @hash[:window_construction][:identifier]
@hash[:window_construction][:identifier] = unshd_id
# derive a new ID for the shaded construction that will not conflict with any bare versions of the construction
shd_id = @hash[:identifier] + '_Shaded'
@hash[:identifier] = shd_id

# create the unshaded construction
unshd_constr_obj = WindowConstructionAbridged.new(@hash[:window_construction])
@construction = unshd_constr_obj.to_openstudio(openstudio_model)

# create the shaded construction
@shade_construction = OpenStudio::Model::Construction.new(openstudio_model)
@shade_construction.setName(shd_id)
@shade_construction.setName(@hash[:identifier])
unless @hash[:display_name].nil?
@shade_construction.setDisplayName(@hash[:display_name])
end
Expand Down

0 comments on commit 462b3ae

Please # to comment.