3

Dependent Arguments

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?

joekers's avatar
263
joekers
asked 2016-07-07 10:57:20 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-08-05 07:56:52 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

4

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

macumber's avatar
12k
macumber
answered 2016-07-07 13:17:43 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
3

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

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2016-07-07 16:30:27 -0500
edit flag offensive 0 remove flag delete 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 (2016-07-07 16:31:09 -0500) edit
add a comment see more comments