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

Revision history [back]

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py write these code which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename to other methods:

def __init__(self, filename_temp):
.
.
fname1 = filename_temp+'.idf'
self.old_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
fname1=self.filename+'.idf'
self.new_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
.
.

Using these attributes and updating self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() since you will be working with idf itself. Gool luck.

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py write you have these code codes which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename to other methods:

def __init__(self, filename_temp):
.
.
fname1 = filename_temp+'.idf'
self.old_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
fname1=self.filename+'.idf'
self.new_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
.
.

Using these attributes and updating self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() since you will be working with idf itself. Gool luck.

luck.

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py you have these codes which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename self.new_idf, self.old_idf, and self.filename to other methods:

def __init__(self, filename_temp):
.
.
fname1 = filename_temp+'.idf'
self.old_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
fname1=self.filename+'.idf'
self.new_idf = IDF(fname1)
self.filename = filename_temp+'_pymod'
.
.

Using these attributes and updating self.new_idf self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() and self.filename since you will be working with idf itself. I think save() works bertter for you. Gool luck.

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py you have these codes which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename to other methods:

 def __init__(self, filename_temp):
 .
 .
 fname1 = filename_temp+'.idf'
 self.old_idf = IDF(fname1)
 self.filename = filename_temp+'_pymod'
 fname1=self.filename+'.idf'
 self.new_idf = IDF(fname1)
 self.filename = filename_temp+'_pymod'
 .
 .

Using these attributes and updating self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() and self.filename since you will be working with idf itself. I think save() works bertter for you. Gool luck.

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy. eppy and you did very good on that. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py you have these codes which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename to other methods:

 def __init__(self, filename_temp):
    .
    .
    fname1 = filename_temp+'.idf'
    self.old_idf = IDF(fname1)
    self.filename = filename_temp+'_pymod'
    fname1=self.filename+'.idf'
    self.new_idf = IDF(fname1)
    self.filename = filename_temp+'_pymod'
    .
    .

Using these attributes and updating self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() and self.filename since you will be working with idf itself. I think save() works bertter for you. Gool luck.

Hi @daniellosg, I'm also a newbie with eppy. Out of curiosity I gave it a shot and looked into your codes. I think there is nothing wrong with eppy and you did very good on that. You made a newbie mistake in your class code! ;) That's why professional users don't answer your post. So here I am! :)

In __init__ method of your Mymodule01.py you have these codes which actually does nothing:

    self.idfo=idf1.idfobjects
    self.ridf=idf1.removeidfobject
    self.nidf=idf1.newidfobject
    self.sidf=idf1.saveas(self.filename+'.idf')

These are just some "variables" associated with the objects of your class. They have no functionality as they are just values! You can change them in other methods of your class but just calling them does nothing and that that's why you see no change in the new idf that you generate.

My recommendation:

Instead of passing these to other methods, just pass the self.new_idf, self.old_idf, and self.filename to other methods:

 def __init__(self, filename_temp):
    .
    .
    fname1 = filename_temp+'.idf'
    self.old_idf = IDF(fname1)
    self.filename = filename_temp+'_pymod'
    fname1=self.filename+'.idf'
    self.new_idf = IDF(fname1)
    self.filename = filename_temp+'_pymod'
    .
    .

Using these attributes and updating self.new_idf at the end of each module will work for your purpose. I'm not sure if you need to use saveas() and self.filename since you will be working with idf itself. I think save() works bertter for you. Gool luck.