Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

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

asked 2022-10-13 22:27:32 -0600

updated 2022-10-16 09:39:15 -0600

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2022-10-14 02:24:43 -0600

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']
edit flag offensive delete link more

Comments

1

This solves my problem! Thanks a lot

Udara Sachinthana's avatar Udara Sachinthana  ( 2023-01-15 05:56:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2022-10-13 22:27:32 -0600

Seen: 974 times

Last updated: Jan 15 '23