First time here? Check out the Help page!

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 2 years ago

updated 2 years ago

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!

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 2 years ago

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']
Preview: (hide)
link

Comments

1

This solves my problem! Thanks a lot

Udara Sachinthana's avatar Udara Sachinthana  ( 2 years ago )

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: 2 years ago

Seen: 995 times

Last updated: Jan 15 '23