Hello, I am trying to write a piece of Eppy code to: 1- open an IDF (created with designbuilder or openstudio) 2- list all windows in the idf file (under FenestrationSurface:Detailed) 3- extract the Building Surface Name parameter from these windows 4- create “Window” objects for each surface in the list generated by the previous step 5- apply fields Construction_Name and Building_Surface_Name to the newly created windows 6- assign Starting_X_Coordinate (x0) = host wall's XCOORDINATE (X0) + WWR formula [could it be x0 = (X2-X0)/2sqrt(WWR) ?] Starting_Z_Coordinate (z0) = host wall's ZCOORDINATE (Z0) + WWR formula window length (x2-x0) = sqrt(WWR)(X2-X0) window height (z2-z0) = sqrt(WWR)*(Z2-Z0)
There is some guidance on that on the jeplus manual
My code looks show a tentative attempt to create a loop but I could not get far. Can anyone help?
## DELETES FENESTRATION SURFACES AND CREATES WINDOWS WITH SAME HOSTS, SAME MATERIALS AND WWR @@LABEL@@
old_fen = idf1.idfobjects['FENESTRATIONSURFACE:DETAILED']
new_win = idf1.idfobjects['WINDOW']
#for w in new_win:
#print w.objls # useful to understand what IDF fields can be called
for w in old_fen:
#print w.objls
old_fen_name = w.Name
new_win1 = idf1.newidfobject('window'.upper()) # the key for the object type has to be in upper case
new_win1.Construction_Name = w.Construction_Name
new_win1.Building_Surface_Name = w.Building_Surface_Name
print new_win1.Building_Surface_Name
# find "new_win1.Building_Surface_Name" (the surface hosting the window) among surfaces
# gather XCOORDINATE and ZCOORDINATE of those host surfaces
# new_win1.Starting_X_Coordinate = XCOORDINATE (host)
# new_win1.Starting_Z_Coordinate = ZCOORDINATE (host)