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
6

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

asked 6 years ago

hnagda's avatar

updated 6 years ago

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?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
8

answered 6 years ago

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 :-)

Preview: (hide)
link

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  ( 6 years ago )
1

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

santoshphilip's avatar santoshphilip  ( 6 years ago )

@santoshphilip Is there any update on this issue?

Mehrdad Vojdani's avatar Mehrdad Vojdani  ( 4 years ago )
3

answered 6 years ago

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.

Preview: (hide)
link

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  ( 6 years ago )
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  ( 6 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

2 followers

Stats

Asked: 6 years ago

Seen: 480 times

Last updated: Apr 19 '19