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

Dependent Arguments

asked 2016-07-07 10:57:20 -0600

joekers's avatar

updated 2017-08-05 07:56:52 -0600

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?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2016-07-07 13:17:43 -0600

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

edit flag offensive delete link more
3

answered 2016-07-07 16:30:27 -0600

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}.

edit flag offensive delete link more

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  ( 2016-07-07 16:31:09 -0600 )edit

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: 2016-07-07 10:57:20 -0600

Seen: 172 times

Last updated: Jul 07 '16