lib/openstudio-standards/btap/geometry.rb in openstudio-standards-0.2.12.rc4 vs lib/openstudio-standards/btap/geometry.rb in openstudio-standards-0.2.12.rc5

- old
+ new

@@ -2174,10 +2174,30 @@ model.getPlanarSurfaceGroups().each {|planar_surface| planar_surface.changeTransformation(t)} return model end + def self.rotate_building(model: , degrees: nil) + + # report as not applicable if effective relative rotation is 0 + if degrees == 0 || degrees.nil? + puts ('The requested rotation was 0 or nil degrees. The model was not rotated.') + return + end + + # check the relative_building_rotation for reasonableness + degrees -= 360.0 * (degrees / 360.0).truncate if (degrees > 360) || (degrees < -360) + + # reporting initial condition of model + building = model.getBuilding + # rotate the building + final_building_angle = building.setNorthAxis(building.northAxis + degrees) + end + + + + module BuildingStoreys #This method will delete any exisiting stories and then try to assign stories based on # the z-axis origin of the space. def self.auto_assign_spaces_to_stories(model) @@ -2822,10 +2842,10 @@ #This method gets the shgc for a surface def self.get_surface_construction_shgc(surface) #a bit of acrobatics to get the construction object from the ConstrustionBase object's name. construction = OpenStudio::Model::getConstructionByName(surface.model, surface.construction.get.name.to_s).get #create a new construction with the requested RSI value based on the current construction. - return BTAP::Resources::Envelope::Constructions::get_shgc(model,construction) + return BTAP::Resources::Envelope::Constructions::get_shgc(surface.model,construction) end #This method gets the tvis for the surface def self.get_surface_construction_tvis(surface) #a bit of acrobatics to get the construction object from the ConstrustionBase object's name.