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

Revision history [back]

It just doesn't know what your model is.

Check out the Mesure Writing Guide, there's a "reporting measure" section that should prove most interesting.

If your case, what you need:

model = runner.lastOpenStudioModel
if model.empty?
  runner.registerError("Cannot find last model.")
  return false
end
model = model.get

# then "model" is actually initialized and you can get your schedules
model.getSchedules...

It just doesn't know what your model is.

Check out the Mesure Writing Guide, there's a "reporting measure" section that should prove most interesting.

If your case, what you need:currently cannot access it in the arguments method.

If you wanted to do something in the run method, you could do this:

model = runner.lastOpenStudioModel
if model.empty?
  runner.registerError("Cannot find last model.")
  return false
end
model = model.get

# then "model" is actually initialized and you can get your schedules
model.getSchedules...

You can see the function signatures for these in ReportingMeasure.hpp.

Note: this used to be called ReportingUserScript before OS 2.0.0.