cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum
GDL coding questions, Python and add-on development using the API Dev Kit.

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.
3 ACCEPTED SOLUTIONS
25 REPLIES 25

runxel
Virtuoso

Reading from a text file is always problematic, because GDL will try to guess the type, thus leading to very nasty errors (think of a room schedule with the room numbers; you'd want e.g. "1.2345" to be text, not a number).

 

So I've mostly given up reading from text files, since it is so unreliable and impossible to control.

 

Also GDL arrays don't like to have mixed type in them.

If the first item in an array is text, the rest will be text, if the first is a number, the rest will be, too.

So my guess is: Your text file has different types as content which trips up Archicad.

Use XML instead.

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

I was aware of that, so I have seperated the operation in multiple simple ones, and it will not continue if the read values doesn't correspond to the parameter type (ie: text for text parameters, numeric for numeric parameters)

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.

@runxel 

 

Now I have a very strange behaviour

 

The 4 th parameter gets updated, but it only shows the values of the previous selection operation, not the updated one 😕😕😕😕😕😕😕😕😕 ???!!!!!*#

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.

Nader Belal
Mentor

Update:

I believe that somehow I'm near to the cause of my problems in GDL, it have to do with if...then..endif, number of Parameter Script execution and Branching decisions at the binary level not GDL

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.

Nader Belal
Mentor

Last Update:

I broke the GDL .... no seriously I really broke it.

Proof:
I have created an array variable ... filled it with string (after initiation)

Passed the values to corresponding parameter arrays in memory

 

Implemented change to the Parameters using Parameters Param=Variable

used Values{2} to get the results ... and bam The GDL editor refused it, saying that the String Parameter Array is a numeric Paramaeter

 

GzC3eXeg7g2yhX9hPuKgigO4yA0E-_kN_XTFbMlZF4k.jpg

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.

Try to set the array type prior to load (something[1]="" or something[1]=0) - it may help because avoids the "guessing" part.

Sometimes I try to lad the all as text and then further phrase....(I have to relay on some database export which is set to export as text so I have extra work..and I deal with 6000x60 or something csv)

Already done that

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.

I had stepped on something - maybe it is also Your case:

My scheme was to load data in macro which was called using returned_parameters, and when I had it in master script the call did not work. I had to move part of the script to the parameter script and it started to work as a charm.

Nope

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.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!