Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

Here's an answer using eppy which might not be what you're looking for but might help someone in the same situation in the future.

from eppy.modeleditor import IDF 

in_file = "eppy/resources/idffiles/V8_1_0/Boiler.idf"  # the path to your IDF
idd = "eppy/resources/iddfiles/Energy+V8_1_0.idd"  # or whatever IDD version you're using

IDF.setiddname(idd)
with open(in_file, 'r') as infile:
    idf = IDF(infile)

# get the surfaces in the model, filtered by having Outdoors as the boundary condition 
surfaces = [s for s in idf.idfobjects['BuildingSurface:Detailed'.upper()] 
            if s.Outside_Boundary_Condition == 'Outdoors']    
total_external_area = sum(s.area for s in surfaces)

# get the glazing surfaces to remove from the total external areas
glazing = idf.idfobjects['FenestrationSurface:Detailed'.upper()]
total_glazing_area = sum(g.area for g in glazing)

# calculate the external areas by orientation
area_by_orientation = defaultdict(float)
for s in surfaces:
    surface_area = s.area - sum(g.area for g in glazing 
                                if g.Building_Surface_Name == s.Name)
    area_by_orientation[s.azimuth] += surface_area

# print the results
print "Areas by orientation"
for area in area_by_orientation:
    print "%s: %.2f m2" % (area, area_by_orientation[area])

print
print "Total area: %.2f" % total_external_area
print "Total glazed area: %.2f" % total_glazing_area

Areas by orientation

0.0: 125.77 m2

90.0: 28.80 m2

180.0: 33.60 m2

270.0: 30.72 m2

Total area: 226.58

Total glazed area: 7.68

Here's an answer using eppy eppy which might not be what you're looking for but might help someone in the same situation in the future.

from eppy.modeleditor import IDF 

in_file = "eppy/resources/idffiles/V8_1_0/Boiler.idf"  # the path to your IDF
idd = "eppy/resources/iddfiles/Energy+V8_1_0.idd"  # or whatever IDD version you're using

IDF.setiddname(idd)
with open(in_file, 'r') as infile:
    idf = IDF(infile)

# get the surfaces in the model, filtered by having Outdoors as the boundary condition 
surfaces = [s for s in idf.idfobjects['BuildingSurface:Detailed'.upper()] 
            if s.Outside_Boundary_Condition == 'Outdoors']    
total_external_area = sum(s.area for s in surfaces)

# get the glazing surfaces to remove from the total external areas
glazing = idf.idfobjects['FenestrationSurface:Detailed'.upper()]
total_glazing_area = sum(g.area for g in glazing)

# calculate the external areas by orientation
area_by_orientation = defaultdict(float)
for s in surfaces:
    surface_area = s.area - sum(g.area for g in glazing 
                                if g.Building_Surface_Name == s.Name)
    area_by_orientation[s.azimuth] += surface_area

# print the results
print "Areas by orientation"
for area in area_by_orientation:
    print "%s: %.2f m2" % (area, area_by_orientation[area])

print
print "Total area: %.2f" % total_external_area
print "Total glazed area: %.2f" % total_glazing_area

Areas by orientation

0.0: 125.77 m2

90.0: 28.80 m2

180.0: 33.60 m2

270.0: 30.72 m2

Total area: 226.58

Total glazed area: 7.68