We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.
SOLVED!

Retrieve an array from the model view options

Mathias Jonathan
Advocate

Hi!

I want to create an object that show the id of the object in plan.

But if the identifier of this object is present in the MVO list, I want it to display the text chosen by the user in the model view options (an abbreviation in my case)

 

Capture d’écran 2023-05-19 à 10.10.25.png

 

I am not really experienced in GDL, so I don't know how to retrive an array from an other script.

 

!!!!!!!!!!!!!!SCRIPT PRINCIPAL

DIM valueT [][]

succes = LIBRARYGLOBAL ("OVM_Remplacement", "arrayValeurs" , req_arrayValeurs)



!!!! THIS PART DOESN'T WORK AT THE MOMENT


!for i = 1 to 3
!valueT[i][1]=req_arrayValeurs[i][1]
!valueT[i][2]=req_arrayValeurs[i][2]
!
!next i
!


Request ("ID_of_Main","",test)

compteur=test

!for i = 1 to 3
!IF test = valueT[i][1] THEN
!compteur=valueT[i][2]
!ENDIF
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
kuvbur
Enthusiast

LIBRARYGLOBAL work only with 1d array

Structural engineer, developer of free addon for sync GDL param and properties

View solution in original post

3 REPLIES 3
Solution
kuvbur
Enthusiast

LIBRARYGLOBAL work only with 1d array

Structural engineer, developer of free addon for sync GDL param and properties

It worked well after making two 1d arrays. Thank you a lot!

Technically, returned arrays (libraryglobal, request, returned_parameters, ....) can be used as two-dimensional if declared with a fixed size in the receiving script. There are not many use cases when you know the size in advance.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest