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

How to specify fields with "-" in eppy?

asked 2020-01-05 19:41:10 -0600

katsuya.obara's avatar

I have been using eppy for idf manipulation and it has been working well referring to eppy documentation.
However, I have problem specifying fields with "-".
For example X-Coordinate of Reference Point in Daylighting:ReferencePoint or Vertex 1 X-coordinate in BuildingSurface:Detailed.
Does anyone know how I should deal with - in fields using eppy?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2020-01-05 21:14:08 -0600

updated 2020-01-05 21:19:17 -0600

The following will set the X coordinate of the reference point to 0:

daylgtctrl = idf_file.idfobjects["Daylighting:ReferencePoint".upper()][0]
daylgtctrl.XCoordinate_of_Reference_Point = 0

Daylighting:ReferencePoint,
Core_Retail_DaylRefPt1,    !- Name
Core_Retail,              !- Zone Name
0,                        !- XCoordinate of Reference Point
14.2,                     !- YCoordinate of Reference Point
0.0;                      !- ZCoordinate of Reference Point

You can also get all field names of an object are by using .fieldnames:

daylgtctrl.fieldnames

['key',
 'Name',
 'Zone_Name',
 'XCoordinate_of_Reference_Point',
 'YCoordinate_of_Reference_Point',
 'ZCoordinate_of_Reference_Point']

If you know the index of the field, you can use it instead of its name as such:

daylgtctrl[daylgtctrl.fieldnames[3]] = 0

Daylighting:ReferencePoint,
Core_Retail_DaylRefPt1,    !- Name
Core_Retail,              !- Zone Name
0,                        !- XCoordinate of Reference Point
14.2,                     !- YCoordinate of Reference Point
0.0;                      !- ZCoordinate of Reference Point
edit flag offensive delete link more

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

2 followers

Stats

Asked: 2020-01-05 19:41:10 -0600

Seen: 259 times

Last updated: Jan 05 '20