First time here? Check out the Help page!
1 | initial version |
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 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.
2 | No.2 Revision |
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 the object 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.