Revision history  [back]

You can call surface.windowToWallRatio on any surface in the model and it will give you the window to wall ratio for that surface. For the AEDG measures we made a helper method that lets you pass in an array of spaces (so it could be the entire building or portion of it). It returns the window to wall ratio. This for example excludes interior windows and does take zone multipliers into account.

Here is a link to one of those measures. There is also a more complex method that returns the window to wall ratio by orientation in the same OSLib_Geometry.rb file. The file is in the resources folder that comes with the measure. For reference the code to the more basic version is below.

def OsLib_Geometry.getExteriorWindowToWallRatio(spaceArray)

  # counters
  total_gross_ext_wall_area = 0
  total_ext_window_area = 0

  spaceArray.each do |space|

    #get surface area adjusting for zone multiplier
    zone = space.thermalZone
    if not zone.empty?
      zone_multiplier = zone.get.multiplier
      if zone_multiplier > 1
      end
    else
      zone_multiplier = 1 #space is not in a thermal zone
    end

    space.surfaces.each do |s|
      next if not s.surfaceType == "Wall"
      next if not s.outsideBoundaryCondition == "Outdoors"

      surface_gross_area = s.grossArea * zone_multiplier

      #loop through sub surfaces and add area including multiplier
      ext_window_area = 0
      s.subSurfaces.each do |subSurface|
        ext_window_area = ext_window_area + subSurface.grossArea * subSurface.multiplier * zone_multiplier
      end

      total_gross_ext_wall_area += surface_gross_area
      total_ext_window_area += ext_window_area
    end #end of surfaces.each do
  end # end of space.each do


  result = total_ext_window_area/total_gross_ext_wall_area
  return result

end

You can call surface.windowToWallRatio on any surface in the model and it will give you the window to wall ratio for that surface. For the AEDG measures we made a helper method that lets you pass in an array of spaces (so it could be the entire building or portion of it). It returns the window to wall ratio. This for example excludes interior windows and does take zone multipliers into account.

Here is a link to one of those measures. There is also a more complex method that returns the window to wall ratio by orientation in the same OSLib_Geometry.rb file. The file is in the resources folder that comes with the measure. For reference the code to the more basic version is below.

 def OsLib_Geometry.getExteriorWindowToWallRatio(spaceArray)

 # counters
 total_gross_ext_wall_area = 0
 total_ext_window_area = 0

 spaceArray.each do |space|

   #get surface area adjusting for zone multiplier
   zone = space.thermalZone
   if not zone.empty?
     zone_multiplier = zone.get.multiplier
     if zone_multiplier > 1
     end
   else
     zone_multiplier = 1 #space is not in a thermal zone
   end

   space.surfaces.each do |s|
     next if not s.surfaceType == "Wall"
     next if not s.outsideBoundaryCondition == "Outdoors"

     surface_gross_area = s.grossArea * zone_multiplier

     #loop through sub surfaces and add area including multiplier
     ext_window_area = 0
     s.subSurfaces.each do |subSurface|
       ext_window_area = ext_window_area + subSurface.grossArea * subSurface.multiplier * zone_multiplier
     end

     total_gross_ext_wall_area += surface_gross_area
     total_ext_window_area += ext_window_area
   end #end of surfaces.each do
 end # end of space.each do


 result = total_ext_window_area/total_gross_ext_wall_area
 return result

end

end