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

Change ChoiceArgument parameters based on user input

asked 2019-09-23 10:30:15 -0500

I am trying to allow a user to select from two dropdowns, but I want the argument of the second dropdown to be filtered based on the input of the user in the first dropdown. A simplified example would be:

states_hash = ['Texas' => ['red', 'blue'], 'Oklahoma' => ['green', 'purple']]

# adding argument for state
state = OpenStudio::Measure::OSArgument.makeChoiceArgument('state', states_hash.keys, true)
args << state

# adding argument for color
color = OpenStudio::Measure::OSArgument.makeChoiceArgument('color', states_array[state], true)
args << color

The first argument computes fine, but for the second one, states_array[state] is empty because (I believe) that when the measure loads, state is nil. Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-23 10:52:45 -0500

Dynamic measure arguments aren't supported:

edit flag offensive delete link more


Unfortunate, they would be really helpful in the PAT. Thanks!

Luis Lara gravatar image Luis Lara  ( 2019-09-23 11:10:13 -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


Asked: 2019-09-23 10:30:15 -0500

Seen: 55 times

Last updated: Sep 23 '19