If you add array parameters to a GDL object that is already in use, error messages can occur with already placed objects because the array values of the placed objects do not exist in the ArchiCAD database.
You can avoid this problem by running through the parameter script in the event that an array parameter does not exist, so that the array is filled.
This could look like this:
! Defined array parameter "param_array_1[2]" ! ---------------------------------------------------------------------- ! ! Expand ARRAY parameters (SECURE) ! ---------------------------------------------------------------------- ! IF VARDIM1(param_array_1) < counter_param THEN arrDim = VARDIM1(param_array_1) FOR i = arrDim + 1 TO counter_param param_array_1[i] = 0 PARAMETERS param_array_1[i] = param_array_1[i] NEXT i ENDIF
You can find a routine that creates this script automatically here.
If you want to convert a regular parameter into an array parameter, you need to pay attention to something else: for example, in a gable roof object I have 4 downpipes, whose downpipe base point is set for all downpipes via the parameter "fallobst". If I want to set each downpipe individually via an array value of a parameter, it is best to create a new parameter so that the existing parameter settings for already placed objects are not "messed up".
I then change the height variable of the downpipes in the 3D script from "fallobst" to "fallobst_dim[1]", "fallobst_dim[2]", "fallobst_dim[3]", "fallobst_dim[4]", but assign the value of the old variable to these new values in case the array is smaller than 4 fields.
IF VARDIM1(fallobst_dim) < 4 THEN
FOR i = 1 TO 4
fallobst_dim[i] = fallobst
PARAMETERS fallobst_dim[i] = fallobst_dim[i]
NEXT i
ENDIF