cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

IF statement for "Values" (SOLVED BEFORE I POSTED THIS)

Anonymous
Not applicable
I have a list of values for a parameter. For example;
VALUES "Number" 'One', 'Two', 'Three', 'Four'

What I would like to know is if there is a simple way for an IF/OR statement to include all the values in one shot. The way I do it now is;
IF Number = "One" OR Number = "Two" or (and so on)

Something like IF Number = "Any of its values" THEN ............

So as I was writing this post I had a thought which seems to have worked the way I wanted it to. Basically if the Number parameter is not empty then do something.
IF Number <> "" THEN ............

I figured I'd continue with the post in case it might help someone else and to see if maybe there are other thoughts on this.

Doug
4 REPLIES 4
Barry Kelly
Moderator
Why bother with the IF/THEN statement at all if it doesn't matter what the value of Number is?

Unless you are allowing for a blank value (i.e. VALUES "Number" 'One', 'Two', 'Three', 'Four', '' or VALUES "Number" 'One', 'Two', 'Three', 'Four', Custom)


Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Nader Belal
Mentor
Hi @Barry

I was wondering if there was a way to use snippet that you have just shared with custom values but with values{2} instead of values ?
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.
Barry Kelly
Moderator
Moonlight wrote:
I was wondering if there was a way to use snippet that you have just shared with custom values but with values{2} instead of values ?
I haven't used a lot of VALUES{2} in my coding - haven't really had the need.
But I don't think you can use CUSTOM (or RANGE ?) with VALUES{2} because you are linking a value definition with an expression, so it is not something that the user can input as a custom value.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Nader Belal
Mentor
Thank you for the confirmation @Barry Kelly

The only way to make it using "Custom" is by creating another parameter that is only activated when the parameter associated with value{2} have the string value of custom
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.