Parametric Analysis using EPPY, EPPY unable to find field parameters? [closed]
Hi all,
As the title says I am trying to generate parametric analysis however, when I pass the function my argument for "parameter" I am unable to assign it as an EPPY attribute and get this error:
"eppy.bunch_subclass.BadEPFieldError: unable to find field parameter"
In this case I am trying to tell it to select the "Tilt_Angle_from_WindowDoor" field in the "Shading:Overhang" Object but it doesn't seem to take. I know the field name is correct as it works outside of the function.
def single_valStudy(value_range,IDF,IDF_obj,obj_range,parameter,FileName,folder_path):
study=[]
for i in range(0,(len(value_range)),1):
for b in range(0,obj_range,1):
idf_l=IDF
a=idf_l.idfobjects[IDF_obj][b]
c=parameter
d=a.c=value_range[i]
study.append(idf_l)
os.chdir(folder_path)
idf_l.saveas(FileName.format(d))
return study
replace:
with
see what happens
Can you respond, and let me know if
d=a[c]=value_range[i]
is fixing the error. (I am not sure if that is the problematic line). If that is the error, I'll write an answer to this question, explaining why it threw that errorApologies, currently away from the desk right now. I can let you know in a couple hours.
Adding the brackets rather than the '.' worked and it accepted the passed the argument. Thank you for the help.
a.Tilt_Angle_from_WindowDoor
internally becomes:
This is the reason
a.c
does not work sincea.c
becomesa['c']
internally. So you have to doa[c]
which is reallya['Tilt_Angle_from_WindowDoor']
sincec= Tilt_Angle_from_WindowDoor
Unfortunately the question has been closed. This response should have been an answer rather than a comment.