BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Display values{2} string values, not numeric

matjashka
Enthusiast
Hi, maybe this is obvious, but I could not find it anywhere:

How do I retrieve the String part of the new(er) values{2} definition without using the old method of matching the numeric variable with a string equivalent?
values{2} "myValue" 1, 'First option', 2, 'Second Option'
Parameters in user dialog box will display the string part of the pair, how about scripts?
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA
4 REPLIES 4
sinceV6
Advocate
Hi.
For a couple of options for values{2}, direct input is ok. If you plan to have several options or need access to the string values in the script, you should define the pairs (integers and strings) in separate arrays that you then assign with values{2} to the parameter. This will give you a lot of flexibility when editing the arrays' values.

What do you need the string value for? The values{2} command was introduced so you can use the integer part of the pair to make comparisons and other operations, since this will be faster than comparing the string values.

Best regards.
matjashka
Enthusiast
I just wanted to remind the user what option was selected in a different part of the interface, so there's no surprise about lack of certain functionality.

I just think it's better usability that way. Nothing mission-critical.

[edit] And, obviously, thanks for your input!
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA
Nader Belal
Mentor
I remember that I have read about a way using ui_infield (can't remember the number) that although in the GUI you will always see text, the values are actually saved as integers.

If you find it, please let me know
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
JaseBee
Advocate
Ran into this problem today, have to define the values within the ui_infield command

I define them all in the master as arrays, one for integers, one for strings, and one for picture names (with the same amount of rows as the other two) can just be empty strings.

In the parameter I attach the values{2} with the integer and string arrays

then in the ui i use this command.

UI_INFIELD{3} Parameter, x, y, w, h, 8, "", 1, 1, 0, 0, 0, 0, PictureArray, StringArray, IntegerArray

I forget what the ones and zeros are for....

Good Luck.
AC 24 5004 AUS
iMac OSX (10.13.6) 4.2ghz i7
8gb ram/8gb vram
Learn and get certified!