In [3]:
"""read an idf file and print it to screen"""
# ex_readprint.py
from idfreader import idfreader
iddfile = "../iddfiles/Energy+V7_0_0_036.idd"
fname = "../idffiles/V_7_0/5ZoneSupRetPlenRAB.idf"
bunchdt, data, commdct = idfreader(fname, iddfile)
print data # will print the idf file to the terminal
In [ ]:
"""read a idf file and write it disk"""
# ex_readwrite.py
from idfreader import idfreader
iddfile = "../iddfiles/Energy+V7_0_0_036.idd"
fname = "../idffiles/V_7_0/5ZoneSupRetPlenRAB.idf"
bunchdt, data, commdct = idfreader(fname, iddfile)
outfilename = "afile.idf"
txt = str(data)
open(outfilename, 'w').write(txt)
In [5]:
txt = str(data)
print txt[:500]
In [6]:
from idfreader import idfreader
iddfile = "../iddfiles/Energy+V7_0_0_036.idd"
fname = "../idffiles/V_7_0/5ZoneSupRetPlenRAB.idf"
In [7]:
bunchdt, data, commdct = idfreader(fname, iddfile)
In [8]:
# give easy to remember names to objects that you are working on
zones = bunchdt['zone'.upper()] # all the zones
surfaces = bunchdt['BUILDINGSURFACE:DETAILED'.upper()] # all the surfaces
In [9]:
# first zone - zone0
zone0 = zones[0]
In [10]:
# name of zone0
print zone0.Name
In [12]:
# allzone names
zonenames = [zone.Name for zone in zones]
print zonenames
In [13]:
zonevolumes = [zone.Volume for zone in zones]
print zonevolumes
# note that zone volumes are strings, not floats
# future version will automatically have them as floats
In [ ]: