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

Can eppy retain order of the objects as in the original IDF?

asked 2019-04-18 17:46:56 -0600

hnagda's avatar

updated 2019-04-18 19:11:44 -0600

I have a script which uses eppy to generate an Ideal Air Loads (IAL) model from a model with a complete HVAC system. I want to do further processing on this IDF and it is necessary that I have the same order of the objects as in the original IDF (which has a sorted order based on IDF Editor 1.31). Is there a way to retain the original object order in eppy. I am using the idf.saveas() function. Probably there's a different function?

Also, is there a way to retain comments made using '!' ? IDFEditor retains them but can eppy?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
8

answered 2019-04-19 13:20:42 -0600

santoshphilip's avatar

There are two questions here:

  1. Can eppy retain the original order of the idf objects in the file ? Answer: No

  2. Can eppy retain all the original comments (starting with '!') ? Answer: No

Can you open separate issues for 1. and 2. at https://github.com/santoshphilip/eppy.... Describe the issues and propose a solution

Issue 1. may be easy to do. Issue 2. may not be easy to implement in eppy

If this can be implemented, this answer will be updated to reflect the functionality (If you don't open the issues, nothing will be happen :-)

edit flag offensive delete link more

Comments

1

Thanks Santosh! I figured out a way to do both the things using a combination of Eppy and plain text manipulation. I might raise an issue on github soon though and propose the same. I think the second issue of retaining all the original comments could be easier to solve using basic string functions in python than doing it with Eppy.

hnagda's avatar hnagda  ( 2019-04-22 20:45:52 -0600 )edit
1

If it works out, we can put your code into eppy.

santoshphilip's avatar santoshphilip  ( 2019-04-23 09:51:46 -0600 )edit

@santoshphilip Is there any update on this issue?

Mehrdad Vojdani's avatar Mehrdad Vojdani  ( 2020-06-10 17:37:37 -0600 )edit
3

answered 2019-04-19 13:29:39 -0600

As far as I know, there is no way to retain object ordering or comments using eppy idf.saveas(), and I'm unaware of any other save functions that would.

I would recommend using Modelkit for your IDF processing. Modelkit does retain comments and ordering.

edit flag offensive delete link more

Comments

1

I already have some scripts written using Eppy and migrating to a different tool at this point wouldn't be a good idea. Thanks for the suggestion though! I'd look into it for a different task in the future :)

hnagda's avatar hnagda  ( 2019-04-22 20:49:04 -0600 )edit
1

Check out my Modelkit demo videos if you're interested in using Modelkit in the future, let me know if you have any questions.

ericmartinpe's avatar ericmartinpe  ( 2019-04-23 00:43:37 -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

2 followers

Stats

Asked: 2019-04-18 17:46:56 -0600

Seen: 430 times

Last updated: Apr 19 '19