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

EnergyPlus Eppy saveas function

asked 2015-09-28 10:39:27 -0600

nancynanxiaodan gravatar image

updated 2015-09-28 10:44:19 -0600

Hi all, I am new to Eppy. went through the tutorial from the website. It seems can be used very straight forward. And my question here is about the function of SAVEAS.

I noticed that there are 3 save functions in eppy.modeleditor. one is save which works fine, and one is saveas which I tried and did not give me the expected output, same issue with savecopy.

I used following commends: which save the changes I made in IDF file and save it in original idf file.

idf1.saveas("test") which didnt give me any error, however, no "test" file saved.

idf1.savecopy("test") which did not give me any error either, however, no "test" file saved.

I checked with the origin python code of eppy.modeleditor of the function save saveas savecopy. However, I have no idea, which part went wrong when I am trying to save it to a new file named test not in original file.

def saveas(self, filename, lineendings='default'):
    self.idfname = filename

def savecopy(self, filename, lineendings='default'):
    """save a copy as filename""", lineendings=lineendings)

Thanks for your help and kind support Thanks again.

edit retag flag offensive close merge delete


The function has always worked for me. @nancynanxiaodan could you post your script?

Jeremy gravatar image Jeremy  ( 2015-09-28 10:54:58 -0600 )edit

@Jeremy Thanks. I should give a full path rather than just a name of 'test.idf' it works fine now. Thanks sorry for this silly question.

nancynanxiaodan gravatar image nancynanxiaodan  ( 2015-09-28 12:38:20 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-28 11:08:51 -0600

santoshphilip gravatar image

It should work. Rather ... it has always worked for me too.

Try it with the full path name "C:\somewhere\test.idf" and let us know. It may be saving the file where you are not expecting it to.

edit flag offensive delete link more


I suppose I should have posted this as a comment rather than an answer :-(

santoshphilip gravatar image santoshphilip  ( 2015-09-28 11:09:46 -0600 )edit

@santoshphilip yeah I think so, probably it stored somewhere I did not expect.. I will try, if it is not working, I will post my script. Thanks

nancynanxiaodan gravatar image nancynanxiaodan  ( 2015-09-28 12:26:18 -0600 )edit

Thanks! I should give a certain path rather than just a 'test' name. It works fine now.

nancynanxiaodan gravatar image nancynanxiaodan  ( 2015-09-28 12:36:55 -0600 )edit

It will work even without the full path name. It will save it in the directory you are running your script. You can also give relative paths such as "test.idf", "./test.idf", "../test.idf", "../../somewhere/test.idf". They should all work. Note that you use a frontslash "/" even on a windows platform, not a backslash "\".

santoshphilip gravatar image santoshphilip  ( 2015-09-28 13:34:45 -0600 )edit

Your Answer

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

Add Answer


Question Tools

1 follower


Asked: 2015-09-28 10:39:27 -0600

Seen: 254 times

Last updated: Sep 28 '15