cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

flag for values{2}

I would like to create a group for values{2} - values, but it doesn't work. Can anybody help me?

Example:

I have this:

values{2} "A1" 1, 'opt1', 2, 'opt2'
values{2} "A2" 1, 'opt1', 2, 'opt2'
values{2} "A3" 1, 'opt1', 2, 'opt2'
etc.

many parameter with the same values

I would like to control them together, like this

options="1, 'opt1', 2, 'opt2'

values{2} "A1" options
values{2} "A2" options
values{2} "A3" options
etc.

but this doesn't work
Any ideas?
4 Replies 4
Laszlo Nagy
Community Admin
Community Admin
I have not checked this but my first idea is that you should not mix parameter types in a VALUES command. 1 is a number, but 'opt1' is a text. Try this:
values{2} "A1" '1', 'opt1', '2', 'opt2' 
or this:
values{2} "A1" 1, opt1, 2, opt2 
In this second case, opt1 and opt2 should be number type parameters.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac29
Anonymous
Not applicable
First, thanks for the reply,

It's not a mix. I would like a numerical parameter values {2} which have a numerical expression, and descriptions as well.

like here:
http://gdl.graphisoft.com/gdl-basics/parameter-logic/

but my problem is, that as I have many parameters, I have to script this about 10-20 times, and If I have to change the values, I would like that all the 10-20 parameters would change together.

An other question:

Can I refer somehow to the parameters, as a number?

I have parameters like this
A1, A2, A3, etc

and I am looking for a way to loop the value description, like this
for i=1 to number_of_A's
    values{2} "A+number_of_A's"  1, 'opt1', 2, 'opt2', 3, 'opt3', etc
next i
Bruce
Advisor
Arrays are your friend in this instance. You would declare two arrays - one for numerical, one for alpha (can't mix type when used in certain situations). Then you just use the array in your value statement.

E.g. DIM vDesc[],
VNum[]
Bruce Walker
Barking Dog BIM YouTube
Mindmeister Mindmap
-- since v8.1 --
AC27 5060 INT Full | Windows 11 64 Pro | 12th Gen Intel i7-12700H 2.30 GHz | 64 Gb RAM | NVIDIA GeForce RTX 3060 32 Gb
Anonymous
Not applicable
Thanks, arrays are the best

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!