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

If var contains?

JGoode
Advocate
Hello,

Is there a way to filter an array of text by searching if it contains a certain string?
eg
A - 1
A - 2
A - 3
B - 1
B - 2
B - 3

if *array* contains "A" then
...

Is this a possible thing to do?
ArchiCAD 23

Windows 10
8 REPLIES 8
Erwin Edel
Rockstar
Think you can find something like this at page 257 of the GDL reference guide, bit about VALUES{2} where they read string values from a text file and put them in an array.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
JGoode
Advocate
Erwin wrote:
Think you can find something like this at page 257 of the GDL reference guide, bit about VALUES{2} where they read string values from a text file and put them in an array.
The issue is that my list is going to be 2000+ values long so the ability to filter my array is essential. Is there a way to essentially search an array?
ArchiCAD 23

Windows 10
Erwin Edel
Rockstar
Doing this inside a GDL script sounds like a bad idea in terms of slow down inside ArchiCAD, I suspect.

Whatever 2D or 3D display information will eventually end up in the model might constantly look through that long list of things.

Is it an option to use properties, where I think you can import tabbed text files to fill property values, which you can then filter and schedule?
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
JGoode
Advocate
Erwin wrote:
Doing this inside a GDL script sounds like a bad idea in terms of slow down inside ArchiCAD, I suspect.

Whatever 2D or 3D display information will eventually end up in the model might constantly look through that long list of things.

Is it an option to use properties, where I think you can import tabbed text files to fill property values, which you can then filter and schedule?
I thought the same thing. I also thought of the idea to split the files up into different sections but I am struggling to find any sort of way to filter through (if *file 1* = x then use *file 2*. I really don't think there is.

Would the using properties include creating a property object? I am not really familiar with creating properties using tabbed text files
ArchiCAD 23

Windows 10
JGoode
Advocate
So as far as you know, there isn't a way of doing some sort of if string contains "x" then....?
ArchiCAD 23

Windows 10
JGoode
Advocate
Another idea popped into my mind. Is there a way of creating an array based on another array which will only use certain strings?

So I have an array of 10 lines..

A-1, A-2, A-3, A-4, A-5, B-1, B-2, B-3, B-4, B-5

Can I makes those into 2 separate parameter arrays?
X = A-1 Y = B-1
A-2 B-2
A-3 B-3
A-4 B-4
A-5 B-5
ArchiCAD 23

Windows 10
Erwin Edel
Rockstar
I do not work with big arrays of information, but I remember from the ArchiCAD20 upgrade course I took, that you could use excel sheets and tabbed text files to import information to the then new Properties system. So if it is a matter of displaying and filtering external data, this sounds like an easier method.
Erwin Edel, Project Lead, Leloup Architecten
www.leloup.nl

ArchiCAD 9-26NED FULL
Windows 10 Pro
Adobe Design Premium CS5
JGoode
Advocate
Erwin wrote:
I do not work with big arrays of information, but I remember from the ArchiCAD20 upgrade course I took, that you could use excel sheets and tabbed text files to import information to the then new Properties system. So if it is a matter of displaying and filtering external data, this sounds like an easier method.
It seems as though using properties isn't going to be an option for me.
What I really need is to be able to take a single array and split it into different parameters based on if it contains a certain string. Does anyone know if this is something that is possible to do?
ArchiCAD 23

Windows 10