Sorting a macro-generated IDF
Is there a script available from the command line which can take an IDF created by EPMacro (or by hand, Python, etc.) and sort it into the "normal" order as produced by the IDF Editor when choosing the "sorted" order when saving the file?
Comments
A good question indeed. So far I've always opened it in the IDF Editor, changed to version to something else, changed it back to what it was, and used "save" (you can't save it if you didn't change something). It would be a plus to write an extra line of code in my script in order to have it done automatically so I get it sorted, and to re-add the descriptive comments for each line item (you don't have it with Eppy)
If no other solutions come forward
todaysoon then I'll write something for my current project then port it into Eppy. Looks like I can use the format exported by Help > Create objectList.txt as a template.I agree with Annie and Julien. IDF editor change, change back and save is the method I have used to to get a sorted IDF file.
This is an untested guess but I believe the code being used to do the sort is this file available on Github: https://github.com/NREL/EnergyPlus/bl...
If you are looking for the IDF format and order I think that would be in the IDD file for each respective version. I do think an IDF "cleaner" could be valuable. Jamie let us know if you make it. Or NREL guys, if you know of a quicker path that could be used chime in.