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

Revision history [back]

click to hide/show revision 1
initial version

I have changed my accepted answer to this one. @mdahlhausen's code is definitely the way to go!

https://github.com/UnmetHours/openstudio-scripts/tree/master/OpenStudio_CLI_Template

The "ruby -v" check was unnecessary since openstudio can run the rb files.

I did have to add to the PATH variable on Windows with the bin directory inside of the openstudio directory.

The template files run fine, and then you can modify the generate_workflows.rb file to run the measures and combinations that you want. It's well commented and isn't too difficult to modify the examples.

I have changed my accepted answer to this one. @mdahlhausen's code is definitely the way to go!

https://github.com/UnmetHours/openstudio-scripts/tree/master/OpenStudio_CLI_Template

The "ruby -v" check was unnecessary since openstudio can run the rb files.

I did have to add to the PATH variable on Windows with the bin directory inside of the openstudio directory.

The template files run fine, and then you can modify the generate_workflows.rb file to run the measures and combinations that you want. It's well commented and isn't too difficult to modify the examples.

examples.


POST SCRIPT
I ended up bypassing openstudio entirely. I made some functions to parse idf text files, write idf text files, and manipulated all the objects by having an array of arrays, each of which represented an object and all its fields. It took a while to translate all the measures I had written, mostly changing the index I would access field elements with, but it's all working. I found one of the changes from energyplus 8.9 to 9.0 was removing one of the fields of the Boiler:HotWater object, which is why adding a bunch of objects with workspace.addObjects() didn't add any objects.

From there, I'm just using for loops to iterate through measure parameter combinations, and write out all the idf files to simulate into an energyplus run group file. Then it's just one click and come back later.

The OpenStudio CLI script by @mdahlhausen worked by the way, and I based my organization and functions on his and what they outputted, but the problems I was having with workspace.addObject(), workspace.addObjects(), Fan:SystemModel on a Branch object, and not easily being able to change the idd file for Openstudio, I finally bit the bullet and got the ruby measures to run directly on the idf files rather than Openstudio.