2020-08-26
08:18 PM
- last edited on
2024-09-09
11:09 AM
by
Doreena Deng
2020-08-27 12:43 AM
2020-08-27 12:16 PM
Kristian wrote:None actually, haha.
what file type are you opening to extra the data?
2020-08-27 02:16 PM
2020-08-27 02:21 PM
Ralph wrote:Hi Ralph, thanks for tuning in!
In what context will the GDL add-on be called, e.g. within the parameter script? This is important because you can't really make any parameter changes outside of that scope.
2020-08-27 04:38 PM
2020-08-27 07:37 PM
Ralph wrote:Are you sure that this is the way? I couldn't get it to work in my tests. If there was an empty dynamic array passed to the GDL add-on it refused to return anything.
Could you simply define an empty array in the GDL script
2020-08-28 07:48 AM
2020-08-28 11:58 AM
runxel wrote:We are eliminating the use of GDL add-ons from our toolset because they cause too many problems for customers. But from previous tools, we did the following in GDL (rough pseudocode):
I couldn't get it to work in my tests. If there was an empty dynamic array passed to the GDL add-on it refused to return anything.
If I try to access the array in GDL again it always says "out of bounds" which means there is nothing in there.![]()
dim incomingValues[] rowCount = 0 colCount = 0 unused = input(presetChannel, "Get_Array_Par", "requiredParameterName", rowCount, colCount, incomingValues)…and the following in the addon (again, rough pseudocode):
GSErr __GDLEXT_CALL InputFromDataFile(Int32 channel, GS::UniString const &recordID, GS::UniString const &fieldID, Int32 inCount, Int32* outCount, GS::Array<GdlValueRecord> &values, GS::Array<GS::UniString> &strings)
{
//...code to define rows, cols etc here
*outCount = rows * cols + 2;
values.SetCapacity(*outCount);
GdlValueRecord rowRecord, colRecord;
rowRecord.SetLong(rows);
colRecord.SetLong(cols);
values.Push(rowRecord);
values.Push(colRecord);
for (…however you iterate through your array data) {
GdlValueRecord record;
switch (…whatever data type…) {
case intType:
record.SetLong(…int value…);
break;
case realType:
record.SetDouble(…double value…);
break;
case strType:
record.SetString(…next string index…);
strings.Push(…string value…);
upto++;
break;
}
values.Push(record);
}
}
This is a bit rough, but might point you in the right direction. Depends a lot on what you want to do.
2020-08-28 08:00 PM