This is not a noob question.
Basically, I have created a Library part that reads a text file containing values that will drive the modeling of my object.
It's structured that it reads a predefined column, extract the unique values of that column and puts it in an array, then repeats that operation a multiple of times until it reaches to the last predefined column that have all the final unique values (about 4-5 times in total).
The problem arises after the third 3 column to be read, it simple does not update its values.
And the funny part is, the Variable arrays that are being used to update the Parameter Arrays, do get the updates, but the Parameter arrays do not get updated.
How do you overcome that ??
PS: There are not nested ifs...then...endif that exceeds the 3 level.
Solved! Go to Solution.
First of all, I want to thank you all for your effort and suggestions.
Second, I would like to give you the only answer I was able to reach with my limited knowledge and tools that I can master at the moment, after a lot of testing different methods, trial and errors, head scratching, and head banging against the wall.
We can simply put it this way ...
GDL have a limited capacity for nested IF ... Then ... Endif
Whether we like it or not, it's like that, there is no other way round, in fact I believe I have tested the maximum limits, which are:
Maybe a little bit late for you, but I have another Idee, why it does not work for you.
Graphisoft made a limitation in the Parameter Script running circles, to avoid the infinite loops in Parameter handling. It means if A drives B and B drives C, but C in the meantime drives A Parameter it generates an infinite loop and your parameter script will run until the end of time. To avoid this problem the Parameter script is running only a certain times and after stops to run. As I remember this maximal loop numer is 12 (but I'm not sure).
So, based on your problem, maybe it would be better to read your text file in an internal array first and only ones drive the Parameter to get these values.
Maybe it helps... 😉
I used more time more than 3 If Tags in my scripts, so I'm sure it is not the problem... 😉
The problem is not with nested if's.
After a user interaction there can be several parameter script runs, a new one triggered by a values of parameters command, until the parameter values settle. In these batches of runs each parameter can be changed only at most once to avoid infinite loops caused by parameters changing eachother.
The contents of an array parameter aren't kept track of individually, the whole array can change only once. This is a necessary performance optimization.
So if your code needs to change contents of an array is several steps, you need to write it in a way there is only one parameters command, when the values are finalized for all possible conditions.
A generally good approach is making a copy of the parameter at the start of the script, so you can be sure whether you check the original or the modified content.