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

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

asked 2015-09-09 06:11:32 -0500

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)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
8

answered 2015-09-09 09:05:42 -0500

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.

edit flag offensive delete link more

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 gravatar image 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 gravatar image MarkAdams  ( 2016-01-26 08:07:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

1 follower

Stats

Asked: 2015-09-09 06:11:32 -0500

Seen: 93 times

Last updated: Sep 09 '15