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

Object with Random Dimensions - Works only parameter zzyzx

Mario Sacco
Expert
I have created this object to have the possibility to create random dimensions for the same object. (ver. 11)

It's simple:
you position the object on the plan, duplicate it n. times, then open the object and click on the "Create Random Dimensions", OK. The object would have to create random object dimensions, but not completely.

The problem is that it works very well only for ZZYZX Parameter, but it doesn't work for A and B. I don't Know why.
Can somebody help me?
Mario
MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/
5 REPLIES 5
Anonymous
Not applicable
Mario,

I couldn't figure out why this wouldn't work properly by defining the A and B parameters the way you did. I did however make a couple of changes to the script and got it to work. Also if you turn on the "calrnd" parameter, save and close the script, each time you place a new instance of it, it will have a random size. Not sure what I'd ever use it for but it's still a neat object.

Doug

!!!!!MASTER SCRIPT

arnd = RND(1)

IF (GLOB_CONTEXT = 2 OR GLOB_CONTEXT = 3 OR GLOB_CONTEXT 4) AND calrnd = 1 THEN
parameters a = arnd
parameters b = arnd
parameters zzyzx = arnd
PARAMETERS arnd = arnd
ENDIF


!!!!!2D SCRIPT

RECT2 0,0,arnd,arnd

!!!!!3D SCRIPT

BLOCK arnd, arnd, arnd
Mario Sacco
Expert
4thorns wrote:
Mario,

I couldn't figure out why this wo.................

Thank you!
I have tried your script. The problem is similar. Randon objects were been 2d and 3d correctly created, but when I turn off "calrnd", in the parameter setting A and B aren't correct, only ZZYZX is correct. I have done many other tries without results.
I continue to try.
Thank you
Mario
MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/
Anonymous
Not applicable
The problem is in GS implementation of RND function. It is not true random generator but only picker of predefined values 13,36,53,86,48 etc. Try this
!!! MASTER SCRIPT or PARAMETER SCRIPT

IF calrnd = 1 AND (GLOB_CONTEXT = 1 OR GLOB_CONTEXT = 5) THEN
arnd = RND(1)
PARAMETERS arnd = arnd
PARAMETERS A = .1*arnd, B = .1*arnd, zzyzx = .1*arnd
PARAMETERS calrnd = 0 ! optional
ENDIF

If you try it in Libary part editor it will show and behave normal until saving when start from begining of sequence. If you save it with start values of A,B,ZZYZX of 1000 and put it on plan it will only allowed first number of sequence because AC saves the object after every property change and therefore reset RND function.
The only way is to think about your own true RND function.
Anonymous
Not applicable
yes, you need to force it to start from a random position within the number generator's sequence. Try multiplying it by SYMB_POS_X or SYMB_POS_Y, that will force it to generate a random number as they are always different for each object.
Mario Sacco
Expert
Dragan wrote:
The problem is in GS implementation of RND function. It is not true random generator but only picker of predefined values 13,36,53,86,48 etc. ....


Now I understand many behaviors of the results of random.
sdb wrote:
yes, you need to force it to start from a random position within the number generator's sequence. Try multiplying it by SYMB_POS_X or SYMB_POS_Y, that will force it to generate a random number as they are always different for each object.


I started exactly with this method. I'll try again.
Thank you very much!
Mario
MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/