Revision history  [back]

Expanding on @Avi's answer.

The ruby object called model in your code is actually an OpenStudio::Workspace object, not an OpenStudio::Model object. Your measure is an EnergyPlus measure, which means the measure will act on a workspace, not a model, which is your model definition after everything has been converted into an EnergyPlus-readable format. Typically, you define EnergyPlus measure arguments by passing in a workspace, e.g. def arguments(workspace). You can name that variable anything you want, e.g. def arguments(flowers_and_sunshine), and it will still be passed in as a OpenStudio::Workpace object. You can't use OpenStudio::Model methods with an OpenStudio::Workspace object.

So what do you do?

You need to use the .getObjectsByType() method in the workspace object to access schedule objects. Here is some example measure code to do that.

Expanding on @Avi's answer.

The ruby object called model in your code is actually an OpenStudio::Workspace object, not an OpenStudio::Model object. Your measure is an EnergyPlus measure, which means the measure will act on a workspace, not a model, which is your model definition the object after everything has been converted into an EnergyPlus-readable format. Typically, you define EnergyPlus measure arguments by passing in a workspace, e.g. def arguments(workspace). You can name that variable anything you want, e.g. def arguments(flowers_and_sunshine), and it will still be passed in as a OpenStudio::Workpace object. You can't use OpenStudio::Model methods with an OpenStudio::Workspace object.

So what do you do?

You need to use the .getObjectsByType() method in the workspace object to access schedule objects. Here is some example measure code to do that.