First time here? Check our help page!
3

Edit "IDF" fields with "/" (forward slash) using Eppy

Hi network, I am trying to edit idf objects ; overhangs using python code of EPPY library. My objective is to change the field ; Depth as Fraction of Window/Door Height in Shading:Overhang:Projection object. Python code is as below,

image description

idf1 = IDF(path1)

overhang = idf1.idfobjects['Shading:Overhang:Projection'][0]

overhang.Depth_as_Fraction_of_Window/Door_Height = 0.6


SInce "/ " is a python operator I am unable to access the data required. I used underscore(_) to represent spaces. Similarly which charater should be chosen?

Highly appreciate your replies !

Cheers!

Udara Sachinthana's avatar
69
Udara Sachinthana
asked 2022-10-13 22:27:32 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2022-10-16 09:39:15 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

4

I would suggest you start using IPython (= a better interactive prompt) or a Jupyter notebook (which uses IPython, and allows you to execute cells of code, add markdown, etc) so you have TAB completion. That's invaluable when you are exploring things / don't know an API by heart.

Anyways, as you can see below, the '/' is just removed. so use overhang.Depth_as_Fraction_of_WindowDoor_Height for eg.

In the image below I type o. then pressed the TAB key to get the list of autocompletions possibles image description

print(o.objls) can also give you the list of fields.

In [6]: print(o.objls)
['key', 'Name', 'Window_or_Door_Name', 'Height_above_Window_or_Door', 'Tilt_Angle_from_WindowDoor', 'Left_extension_from_WindowDoor_Width', 'Right_extension_from_WindowDoor_Width', 'Depth_as_Fraction_of_WindowDoor_Height']
Julien Marrec's avatar
29.7k
Julien Marrec
answered 2022-10-14 02:24:43 -0500
edit flag offensive 0 remove flag delete link

Comments

1

This solves my problem! Thanks a lot

Udara Sachinthana's avatar Udara Sachinthana (2023-01-15 05:56:17 -0500) edit
add a comment see more comments