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

Revision history [back]

This needs to be documented better in the measure writing guide but there are two options:

Option 1 is to provide a default value that will be used if the user leaves the argument blank. This is done with:

argument.setDefaultValue(100)

Option 2 is to get the value using getOptionalDoubleArgumentValue, if you do this you have to check that the value is initialized before using it:

value = runner.getOptionalDoubleArgumentValue('argument', arguments)
if value.is_initialized
  value = value.get
else
   value = nil
end

This needs to be documented better in the measure writing guide but there are two options:

Option 1 is to provide a default value that will be used if the user leaves the argument blank. This is done in the arguments section with:

argument.setDefaultValue(100)

Option 2 is to get the value using getOptionalDoubleArgumentValue, in the run section, if you do this you have to check that the value is initialized before using it:

value = runner.getOptionalDoubleArgumentValue('argument', arguments)
if value.is_initialized
  value = value.get
else
   value = nil
end

This needs to be documented better in the measure writing guide but there are two options:

Option 1 is to provide a default value that will be used if the user leaves the argument blank. This is done in the arguments section with:

argument.setDefaultValue(100)

Option 2 is to get the value using getOptionalDoubleArgumentValue in the run section, if you do this you have to check that the value is initialized before using it:calling get to retrieve the value:

value = runner.getOptionalDoubleArgumentValue('argument', arguments)
if value.is_initialized
  value = value.get
else
   value = nil
end