First time here? Check out the Help page!

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

Dependent Arguments

asked 8 years ago

joekers's avatar

updated 7 years ago

I'm trying to allow the user to select a space type then select from the lighting schedules in that specific space type. So in essence, I'm trying to make one argument value dependent on the other. Is this possible using OpenStudio ruby script? Also, can I allow the user to select more than one argument in a drop down list?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
4

answered 8 years ago

These are both suggestions on the UserVoice site, multi-choice arguments and dynamic arguments. Head over there and give them a vote!

Preview: (hide)
link
3

answered 8 years ago

As Dan said, for the first one I've already opened a request on user voice a while ago.

For your secondary question (I think it should have been a separate question fyi): "Also, can I allow the user to select more than one argument in a drop down list?"

You can't, but the workaround is to create a bunch of checkboxes.

Do a loop on all your objects and within the loop you use makeBoolArgument to create a checkbox. While you do so, name the arguments so that you can pick them up later. For example, is_#{object.name}. In the run method, loop again on your objects and retrieve whether it was selected or not by checking for the value of is_#{object.name}.

Preview: (hide)
link

Comments

1

If that's not clear let me know, I'll paste some example code tomorrow when I have access to my other computer.

Julien Marrec's avatar Julien Marrec  ( 8 years ago )

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 8 years ago

Seen: 183 times

Last updated: Jul 07 '16