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

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Dynamic hotspots re-setting array values to zero!!?

Anonymous
Not applicable
Help!
I have an array filled with 'random' generated parameters which describe the length and position of timber slats as part of a facade screen system.
The array is filled in in the master script and the slats are drawn in the 3d script. All good up to here.
Now I want to be able to edit the length parameters of any individual slat by using dynamic hotspots. These get created in the same subroutine that draws the slats. These all show up fine and in the right spots BUT when I edit one, all the other values of the array defining the slats are lost - set to zero (except the one I'm editing).
Frustrating. But it gets stranger. The object has a hotspot switch which tells it to regenerate slats in a new 'random' settings. So after editing the one slat and loosing the values on all the others, I hit the switch and they all re-appear in a new layout - fine. Not so strange. But now when I edit a slat from a different position to the previous attempt all other slats return to zero EXCEPT the one I edited previously! It remembers! It's like it's keeping a whole mirror array with these 'edited' values.

I've tried a number of things with no effect, including
Moving the 'random' array generator in the 3d script,
moving the dynamic hotspot code out of the subroutine and transferring the values of the masterscipt array to another array. No dice.

Does anyone know what I'm talking about?

It feels like once again I've missed something fundamental in GDL 101.
4 REPLIES 4
Anonymous
Not applicable
Angry wrote:
Does anyone know what I'm talking about?
Not sure to fully understand, but it reminds me this example.
Something like that? Maybe with some adaptations.
Anonymous
Not applicable
Thanks Oliver, but I could not open/import that.
But found a pc version in an earlier post. Looking at it now.
In the mean time...

I'm not proud of my coding, my lack of formatting or UI (all to come later when I get it working!) but here's the beast I'm working on (note you need to tweak the centre hotspot to generate the slats):
Anonymous
Not applicable
You need to force some parameters to update.
!!! ----- Parameter script -----
parameters SlatdimMaster = SlatdimMaster,
			SlatDims      = SlatDims
It seems to work.
Anonymous
Not applicable
You're right that fixes it!!!
I am very grateful.
I forgot that arrays behave just like any other parameter.
I was chasing down some pretty esoteric lines of thought to figure this out.
I can now move on with the rest of the code and maybe finish before the builder needs the set-out drawings!!

You are a legend!