5

Is there an easy way to show what an OpenStudio field will accept?

For example, I want to change the openstudio::model::SimulationControl::solarDistribution: doc here

I will use setSolarDistribution ( std::string solarDistribution ). Is there a way to return all possibles values accepted by OS? That would be 'MinimalShadowing', 'FullExterior', etc.

In irb, something like help 'OpenStudio::SimulationControl::solarDistribution' (this doesn't work)

Julien Marrec's avatar
29.7k
Julien Marrec
asked 2015-09-09 06:11:32 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

8

You can call OpenStudio::Model::SimulationControl::validSolarDistributionValues(). It will return a list of valid values.

Usually for fields that accept a range of acceptable values, there will be a validFooValues() function.

MarkAdams's avatar
1.8k
MarkAdams
answered 2015-09-09 09:05:42 -0500
edit flag offensive 0 remove flag delete link

Comments

Why doesn't that work for OpenStudio::Model::OutputVariable::validReportingFrequencyValues()? I can see that it checks if it's valid when I call setReportingFrequency because it returns false when it's not appropriate

Julien Marrec's avatar Julien Marrec (2016-01-26 03:49:27 -0500) edit

It seems like the more consistent API naming convention is fooValues(). Also it appears that OutputVariable hasn't implemented it fully. If you look at SimulationControl, OuputVariable should call the getIddKeyNames() function.

MarkAdams's avatar MarkAdams (2016-01-26 08:07:25 -0500) edit
add a comment see more comments