GDL
About building parametric objects with GDL.
SOLVED!

Problem passing values from Variable Array to Parameter Array

Nader Belal
Mentor

Hi everyone,

 

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.

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.
25 REPLIES 25

I am not sure what is happening here, if you can send some stripped-down code & data we will look into it.

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest

Can't send it over here

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.

Hi Nader,
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... 😉


G.

Solution

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.

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest

Go upwards a little bit and start reading from after the comment made by Piotr

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.

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.

 

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest