Format IDF files using command line
Is there a way to run whatever the IDF Editor runs to format the txt of the IDF file, meaning one field per line, field name added as comment, field lines indented, order objects in the IDF file by type, etc?
Based on the comments in the txt file after being formatted, I need a command line something for whatever does this,
!-Generator IDFEditor 1.50
!-Option SortedOrder
The only way I know to get the IDF file formatted and sorted is by opening the IDF Editor, adding a new object, saving the IDF, deleting the newly created object, then saving again.
I need correct formatting for a script I have written to compare PNNL models at different years and in different geographical locations. This very concisely summarizes what ASHRAE standards changed that were applicable to the building type, but the comparison is highly dependent on standard formatting and correct field names.
@mldichter if you're mostly interested in ordering objects in a consistent manner, you could use Eppy to open and save the file.
There's definitely a python script somewhere on Unmethours that Jamie Bull wrote (for windows only). Edit: cf https://unmethours.com/question/535/s...
@Jeremy The order doesn't matter within an object type, but having the objects types separated into groups does matter. More importantly, adding the field names as comments and indenting consistently.
@Jamie Bull Do you have a windows python script for this?
@mldichter if the order doesn't matter, reading and saving the file using Eppy will output an idf file with objects types separated into groups. I think the script Julien refers to is to mimic what the IDF Editor does.