def main(): from StringIO import StringIO import iddv7 IDF.setiddname(StringIO(iddv7.iddtxt)) idf1 = IDF(StringIO('')) loopname = "p_loop" sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] dloop = ['db0', ['db1', 'db2', 'db3'], 'db4'] # makeplantloop(idf1, loopname, sloop, dloop) loopname = "c_loop" sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] dloop = ['db0', ['db1', 'db2', 'db3'], 'db4'] # makecondenserloop(idf1, loopname, sloop, dloop) loopname = "a_loop" sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] dloop = ['zone1', 'zone2', 'zone3'] makeairloop(idf1, loopname, sloop, dloop) idf1.saveas("hh1.idf")
# <codecell> # a small hack to start off import sys pathnameto_eplusscripting = "c:/eppy/eplusscripting/" sys.path.append(pathnameto_eplusscripting) # the above lines will let you run your script from anywhere. # future versions will not need this import modeleditor from modeleditor import IDF iddfile = "../iddfiles/Energy+V7_2_0.idd" IDF.setiddname(iddfile) fname1 = "../idffiles/V_7_2/smallfile.idf" idf1 = IDF(fname1) # <markdowncell> # idf1 now holds all the data to your in you idf file. # # Now that the behind-the-scenes work is done, we can print this file. # <codecell> idf1.printidf() # <markdowncell>
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with eppy. If not, see <http://www.gnu.org/licenses/>. """Name fields may end with Name rather than be Name test this conclusion: just check if the field has a reference""" from modeleditor import IDF from StringIO import StringIO iddname = "../iddfiles/Energy+V8_0_0.idd" IDF.setiddname(iddname) idf = IDF(StringIO("")) idds = idf.idd_info i = 0 bpoint = 5 for fieldidds in idds: i += 1 for fieldidd in fieldidds: if fieldidd.has_key('field') and fieldidd.has_key('reference'): if fieldidd['field'][0].find('Name') != -1: if fieldidd['field'][0] != 'Name': print fieldidd['field'][0], idf.model.dtls[i] if i > bpoint: pass
Temp.append(element) listIsNested = keepChecking #determine if outer loop exits TheList = Temp[:] return TheList loopname = "a_loop" sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] # dloop = ['db0', ['zone1', 'zone2', 'zone3'], 'db4'] dloop = ['zone1', 'zone2', 'zone3'] # makeairloop(idf1, loopname, sloop, dloop) # idf1.saveas("hh1.idf") from StringIO import StringIO import iddv7 IDF.setiddname(StringIO(iddv7.iddtxt)) idf = IDF(StringIO('')) newairloop = idf.newidfobject("AirLoopHVAC".upper(), loopname) fields = SomeFields.a_fields # for use in bunch flnames = [field.replace(' ', '_') for field in fields] # TODO : check if these change too. # simplify naming a_fields = ['Branch List Name', 'Connector List Name',
# \\default 5.0 # # """ # # idftxt = """Version,6.0; # """ # iddhandle = StringIO(iddtxt) # # iddhandle = open(iddfile, 'r') # fhandle = StringIO(idftxt) # # bunchdt, data, commdct = idfreader(fhandle, iddhandle) # s = str(data) # open("fsfs.idf", 'w').write(s) # # iddhandle.close() # fhandle.close() # # ----------- # open using IDF iddhandle = open(iddfile, 'r') fhandle = open(fname, 'r') IDF.setiddname(iddhandle) idf1 = IDF(fhandle) idf1.saveas("isis.idf") # idf1.printidf() # s = idf1.asstring() # print s iddhandle.close() fhandle.close()