Use 3 buttons to select 3 different options from the same parameter?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-03-24 02:38 PM
2020-03-24
02:38 PM
This is code that I've adapted from another object I have. Any help is appreciated.
ui_infield{3} "existing", 0, 100, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e1,e1 ui_infield{3} "existing", 0, 130, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e2,e2 ui_infield{3} "existing", 0, 160, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e3,e3
ArchiCAD 23
Windows 10
Windows 10
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-05-23 02:32 PM
2021-05-23
02:32 PM
The script is correct. Just you need to add to parameter script this line:
VALUES "existing", e1, e2, e3
And do not forget to define e1, e2 and e3 variables before execution of both commands - better in master script.
The way how your script is written, "existing" and e1, e2, e3 must be strings.
VALUES "existing", e1, e2, e3
And do not forget to define e1, e2 and e3 variables before execution of both commands - better in master script.
The way how your script is written, "existing" and e1, e2, e3 must be strings.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-05-24 01:19 AM
2021-05-24
01:19 AM
There are actually a few different ways to do this depending on what you want the UI to look like.
Podolsky is correct; first you need to set the parameter with the list of values in the master script (or parameter script but master is better).
Then you have options in the UI of:
USE the "ui_infield" command as you have done, which is probably the worst way (sorry, harsh but true).
or
USE the "ui_radiobutton" command, which I think is purpose built for exactly what you are trying to do. your UI script would look like this:
of
If you want a really nice UI with picture button that change based on the chosen button then USE
Use the "ui_button" command with the "ui_function" setting and assign a GLOB_UI_BUTTON_ID at the end:
and then in the parameter script write the response to this button being clicked like:
I hope that helps and doesn't confuse things further as having options often does. Basically, if you just need a check box for each option then use the "ui_radiobutton" as it is simple and fast to set up. If you want buttons with images or text then you need to use the last option.
Enjoy,
Podolsky is correct; first you need to set the parameter with the list of values in the master script (or parameter script but master is better).
Then you have options in the UI of:
USE the "ui_infield" command as you have done, which is probably the worst way (sorry, harsh but true).
or
USE the "ui_radiobutton" command, which I think is purpose built for exactly what you are trying to do. your UI script would look like this:
ui_radiobutton "existing", e1, e1, xPOS, yPOS, 20, 16: xPOS = xPOS +20 ui_radiobutton "existing", e2, e2, xPOS, yPOS, 20, 16: xPOS = xPOS +20 ui_radiobutton "existing", e3, e3, xPOS, yPOS, 20, 16: xPOS = xPOS +20
of
If you want a really nice UI with picture button that change based on the chosen button then USE
Use the "ui_button" command with the "ui_function" setting and assign a GLOB_UI_BUTTON_ID at the end:
ui_button ui_function, e1, xPOS, yPOS, 20, 16, 101: xPOS = xPOS +20 ui_button ui_function, e2, xPOS, yPOS, 20, 16, 102: xPOS = xPOS +20 ui_button ui_function, e3, xPOS, yPOS, 20, 16, 103: xPOS = xPOS +20
and then in the parameter script write the response to this button being clicked like:
if GLOB_UI_BUTTON_ID = 101 then parameters "existing" = e1 if GLOB_UI_BUTTON_ID = 102 then parameters "existing" = e2 if GLOB_UI_BUTTON_ID = 103 then parameters "existing" = e3
I hope that helps and doesn't confuse things further as having options often does. Basically, if you just need a check box for each option then use the "ui_radiobutton" as it is simple and fast to set up. If you want buttons with images or text then you need to use the last option.
Enjoy,