We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-03-27 03:43 AM
Hi all,
When you change the width of an array parameter, this change is not passed onto existing objects resulting in them failing to generate as they return an "invalid array width" error. Is there a way to get around this without having to delete all of the relevant parameters, reload all the objects, then recreate the parameters with their new array widths?
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-03-27 11:10 AM
You can always select all respective objects and then "Reset to Default Settings". This fixes it.
Obviously now everything else is reset, too.
Other thing would be to write a migration script which would preserve all other settings, but writing those is tedious.
So, its "pick your poison".
2023-03-27 03:37 PM
I use 2 different approaches:
a) If the array-size is not dynamically, I write e.g.:
IF VARDIM1(array) < yx THEN
FOR i = VARDIM1(array) TO no_array
PARAMETERS array[i] = "..."
NEXT i
b) If the array size is dynamically I add an update checkbox
and let the Parameter-Script run once with GLOB_MODPAR_NAME.
After this the update checkbox disappears.
2023-03-27 03:45 PM - edited 2023-03-27 05:47 PM
I wish there was greater clarity on Array definitions and how they react in certain situations.
The Forward Migration script suggested by @runxel maybe the best option, that way you can keep your existing object in working order. My understanding of the Migration Script is the default is to populate the new parameters with the old parameters as long as they are still present. You don't need to list and action them all. The only one you would need to process would be the array, unless you have other array related values. You could try creating a new Parameter Array and migrate the values with For - Next loops. The following read values from a redundant one dimension array and added the values to a new two dimension array.
DIM arrTemp1[]
xx = DELETED_PAR_VALUE ("arrDimx1", arrTemp1)
FOR n = 1 TO VARDIM1(arrTemp1)
arrDimx2[n][8] = arrTemp1[n]
NEXT n
PARAMETERS arrDimx2 = arrDimx2