2021-11-17 05:20 PM - last edited on 2022-09-26 10:36 PM by Daniel Kassai
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.
2021-12-13 04:45 PM
I am not sure what is happening here, if you can send some stripped-down code & data we will look into it.
2021-12-13 04:53 PM
Can't send it over here
2022-02-01 09:40 AM - edited 2022-02-01 09:44 AM
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... 😉
2022-03-11 10:07 AM
I have to admit you were right. I managed to re-create the problem with an array parameter. Without arrays the result is as expected.
We are inspecting this as a bug.
2022-03-11 10:28 AM
Go upwards a little bit and start reading from after the comment made by Piotr
2022-03-21 03:25 PM
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.