The OpenStudio Ruleset sub-project provides classes for building model parameterization, manipulation, and queries. UserScripts are typically instantiated in Ruby scripts packaged as BCLMeasures (see openstudio::BCLMeasure in the utilities sub-project).
UserScripts
Every OpenStudio UserScript/BCLMeasure is a class, typically written in Ruby, that derives from one of the classes listed below (ModelUserScripts are the most common).
UserScripts are folded into OpenStudio workflows using the classes:
- OSArgument - Class for specifying and setting values for script arguments.
- OSResult - Class for capturing an overall result flag; error, warning, and info messages; and the initial and final conditions that occur during a single instance of running a user script (typically on an energy model).
- OSRunner - Class for running scripts. All of the UserScript classes expect a class derived from OSRunner to be passed in to the run method. The base class provies helper methods for checking arguments and aggregating results. There is typically one derived class per application, which can be used to customize application behaviors (finding available measures/scripts, alerting the user when there is an error, etc.)
- RubyUserScriptArgumentGetter - Standard methods for retrieving UserScript arguments using embedded or native Ruby.
For more information, see BCLMeasure (in utilities/bcl/), runmanager::RubyJobBuilder, analysis::RubyPerturbation, analysis::RubyContinuousVariable, the SketchUp Plug-in (user script menu), the OpenStudio Application (scripts tab), analysisdriver::SimpleProject, and the Parametric Analysis Tool (PAT).