First time here? Check our help page!
7

Does anyone have a simple OS measure template that just calls other measures?

I find myself using a few dozen 'Run Measure Now" measures over and over again. They also need to be run in a certain order. Does anyone have a simple template that I could use to automate that process? Some of the measures need input, so could that also be done in a meta-measure?

Would it be better to just copy the contents of all the measures I want into a single one?

Has anyone tried something like this before?

joshdr83's avatar
103
joshdr83
asked 2017-10-06 20:42:58 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-10-07 09:29:17 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

7

We have a meta_measure.rb helper script you may be interested in. It's not really documented, but the script will:

  1. Help you get your measures and measure arguments in the needed format (call update_args_hash method once for each measure).
  2. Runs the measures with checks for valid arguments as possible (call apply_measures method).
  3. (Optional) Runs the measures in the order specified by a user-defined json file (workflow_json argument to above method). If not provided, it will simply run the measures in the order that you added measures/arguments.
  4. (Optional) Creates a measures.osw that includes all the measures and measure arguments that were run for debugging purposes (osw_out argument to above method).
  5. (Optional) Shows the measures & arguments called for debugging purposes via runner.registerInfo (show_measure_calls argument to above method).

Here is a simple example of it being used.

shorowit's avatar
11.8k
shorowit
answered 2017-10-10 09:55:29 -0500, updated 2019-04-20 19:15:38 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
5

Yes, there is a way to call a measure, or multiple measures from inside another measure, but that does take a little but of setup. You can borrow the code from measure tests, and place it in the run section of a measure. Do this multiple times to run more than one measure. File management of measures can create issues.

Another idea you might consider is to create a new OSM file, and then place all the measure you want to run in the workflow of measures tab. Now quit OpenStudio. You can now run 'workflow.osw' using the CLI to quickly run all the measure on any OSM file. Here is link to CLI documentation

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2017-10-10 00:51:10 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments