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

Revision history [back]

When an optional is returned, it may or may not have a value inside it. You need to use special code to retrieve its value if one exists. See the "OpenStudio Measures and the boost::optional Type" section of the Measure Writer's Guide for a good explanation of how to handle this.

In your specific case, the returned value is optional because OpenStudio models can be created that do not have the number of stories specified.

When an optional value is returned, it may or may not have a value inside it. You need to use special code to retrieve its value if one exists. See the "OpenStudio Measures and the boost::optional Type" section of the Measure Writer's Guide for a good explanation of how to handle this.

In your specific case, the returned value is optional because OpenStudio models can be created that do not have the number of stories specified.