# # supply side sbranchs = [] for bname in sbranchnames: branch = hvacbuilder.makeductbranch(idf, bname) sbranchs.append(branch) # rename inlet outlet of endpoints of loop anode = "Component_1_Inlet_Node_Name" sameinnode = "Supply_Side_Inlet_Node_Name" # TODO : change ? sbranchs[0][anode] = newairloop[sameinnode] anode = "Component_1_Outlet_Node_Name" sameoutnode = "Supply_Side_Outlet_Node_Names" # TODO : change ? sbranchs[-1][anode] = newairloop[sameoutnode] # rename inlet outlet of endpoints of loop - rename in pipe dname = sbranchs[0]['Component_1_Name'] # get the duct name aduct = idf.getobject('duct'.upper(), dname) # get duct aduct.Inlet_Node_Name = newairloop[sameinnode] dname = sbranchs[-1]['Component_1_Name'] # get the duct name aduct = idf.getobject('duct'.upper(), dname) # get duct aduct.Outlet_Node_Name = newairloop[sameoutnode] # # # demand side # dbranchs = [] # for bname in dbranchnames: # branch = makepipebranch(idf, bname) # dbranchs.append(branch) # # rename inlet outlet of endpoints of loop - rename in branch # anode = "Component_1_Inlet_Node_Name" # sameinnode = "Demand_Side_Inlet_Node_Name" # TODO : change ? # dbranchs[0][anode] = newcondenserloop[sameinnode] # anode = "Component_1_Outlet_Node_Name"
sloop = ['sb0', ['sb1', 'sb2', 'sb3'], 'sb4'] dloop = ['db0', ['db1', 'db2', 'db3'], 'db4'] hvacbuilder.makeplantloop(idf, loopname, sloop, dloop) idf.saveas("hhh1.idf") # replacebranch(loop, branch, listofcomponents) # loop = loop of name p_loop # branch = branch of name sb1 # make pipe components np1, np2 # pipe1 = hvacbuilder.makepipecomponent(idf, 'np1') # pipe2 = hvacbuilder.makepipecomponent(idf, 'np2') # idf.saveas("hhh2.idf") pipe1 = idf.newidfobject("PIPE:ADIABATIC", 'np1') chiller = idf.newidfobject("Chiller:Electric".upper(), 'Central_Chiller') pipe2 = idf.newidfobject("PIPE:ADIABATIC", 'np2') # pipe3 = idf.newidfobject("PIPE:ADIABATIC", 'np4') # pipe4 = idf.newidfobject("PIPE:ADIABATIC", 'np4') # idf.saveas("hhh2.idf") loop = idf.getobject('PLANTLOOP', 'p_loop') branch = idf.getobject('BRANCH', 'sb0') # listofcomponents = [pipe1, chiller, pipe2] listofcomponents = [chiller, pipe1, pipe2] newbr = hvacbuilder.replacebranch(idf, loop, branch, listofcomponents, 'Water', False) print newbr.obj # print branch idf.saveas("hhh_new.idf")