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

If var contains?

JGoode
Enthusiast
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 17, 19, 21 and 23
Windows 8
8 REPLIES 8

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-24 NED FULL
Windows 10 Pro
Adobe Design Premium CS5

JGoode
Enthusiast
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 17, 19, 21 and 23
Windows 8

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-24 NED FULL
Windows 10 Pro
Adobe Design Premium CS5

JGoode
Enthusiast
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 17, 19, 21 and 23
Windows 8

JGoode
Enthusiast
So as far as you know, there isn't a way of doing some sort of if string contains "x" then....?
ArchiCAD 17, 19, 21 and 23
Windows 8

JGoode
Enthusiast
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 17, 19, 21 and 23
Windows 8

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-24 NED FULL
Windows 10 Pro
Adobe Design Premium CS5

JGoode
Enthusiast
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 17, 19, 21 and 23
Windows 8

Didn't find the answer? Start a new discussion

Labels

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!