Got a minute? We appreciate your feedback:

Graphisoft Learn survey
About building parametric objects with GDL.

Request changes Array format


I have a 2D Parameter array in object A which is formatted as Array [m][n] but in object B when I use REQUEST I end up with Array [1][m x n] in the imported array and dim1 & dim2 values. Any suggestions why this is happening before I transfer the values into a new 2D array?

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

This is a complicated question (kind of) but seems relevant to the code, can you post something or an image with more info? Debugging is difficult with such minimal information.


Things are pretty much as I suggested above, but I will try to expand.

In Object A (subtype: Wall) I have a parameter array MyArray[m][n] which is correctly reporting changes & values of real numbers.

In Object B (subtype: Label) I want to import that array so I use...

n = REQUEST ("ASSOCLP_PARVALUE", "MyArray" , name_or_index, type, flags, dims1, dims2, MyArray)
MyArray = MyArray
PARAMETERS MyArray = MyArray

!dims1 & dims2 correctly supply values m & n
!VARDIMS1(MyArray) = 1 & VARDIMS2(MyArray) = m * n

The MyArray[m][n] parameter values in Object B aren't updating, but that may be a different issue.

In Object B if I want to use the values in MyArray I have to use Value = MyArray[1][m x n]. 


Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)


@SenecaDesignLLC Thanks for the response, I guess I should spend a bit more time with the manual...

p_values: for ASSOCLP_PARVALUE returns the parameter value or array of values. The array elements are returned successively, row by row as a one dimensional array, independently of the dimensions of the variable specified to store it. If the variable is not a dynamic array, there are as many elements stored as there is room for (for a simple variable only one, the first element). If values is a two dimensional dynamic array, all elements are stored in the first row.


Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Yeah, you found the critical text.


Btw same holds true for macro returns, and returns from any GDL Addons. The returned array will be always one-dimensional.

Lucas Becker | AC 27 on Mac | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!