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.

Random parameters in Doors and Window

Anonymous
Not applicable
I don't know if its possible, but I wanted the shutters and panels of my windows within the hotlinked modules to open randomly in my project... Its annoying to see all of them closed or open in my renders...
BTW It would be great if Graphisoft create this feature to all library parts, isn't it?
7 REPLIES 7
Dwight
Newcomer
I understand that certain parts of your modules revert to a default when placed...... ??

If you need a solution now instead of waiting for new setting from HQ, I wonder if saving the parts in question set as you need with new names and substiuting them in the module would solve the problem. ?
Dwight Atkinson
Anonymous
Not applicable
Hi Dwight,

I started to try a gdl solution... and then I came with this piece of code to put in the master script of the door or window:

IF RNDOPEN THEN
openrand=INT(RND(10))
PARAMETERS gs_open_3D=90*NOT(openrand>=4)
PARAMETERS gs_shut_open=1*(openrand>=4)
ENDIF

I created a boolean variable (RNDOPEN) to control the randomness...
I've made some tests with modules and it works!

What do you think?
Djordje
Virtuoso
You mean it works in the module itself, but does not work when the module is inserted?

Try Merge and see if it happens then. Save under a different name of course ...

What are your modules? Whole buildings or flats/rooms?

Are you using MOD or PLN?
Djordje



ArchiCAD since 4.55 ... 1995
HP Omen
Frank Beister
Moderator
Each time you go to the settings dialog or you change the window by a moveable hotspot the opening is changed. If this is OK for you. Well done.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Hi Djordje and F.Beister,
Djordje wrote:
What are your modules? Whole buildings or flats/rooms?
Are you using MOD or PLN?
I'm using modules (MOD) for hotel rooms... They seem to work pretty fine every time I copy or insert another module... Now I can get windows open randomly within the instances of a single module
F. wrote:
Well done.
Coming from a GDL Master as you are is always a great honor. Thank you!
Frank Beister
Moderator


I say "Well done", because you don't change gs_shut_open and gs_open every time the script runs to a random value, but only in the moment you do changes in the window settings. The random value is effective only in the moment PARAMETERS works and that's only in the moment GLOB_SCRIPT_TYPE=5 (and some other minor circumstances), means you are in the settings dialog or dragging a hotspot. This bewares of flickering of the openings in different views or animations.

One could use instead of RND a mixture of "random" parameters of the object as GUID, Position, Elevation, Rotation of the wall. But I think your way is pretty good.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
F. wrote:
The random value is effective only in the moment PARAMETERS works and that's only in the moment GLOB_SCRIPT_TYPE=5 (and some other minor circumstances), means you are in the settings dialog or dragging a hotspot. This bewares of flickering of the openings in different views or animations.
I didn't know that I guess its what they call "The luck of the newbie"

BTW... I'm developing the idea by controling the probability of a "Closed window" in the randomness. So I created an integer variable named RNDPROB for it. Here it goes:

Parameters Script:
VALUES "RNDPROB" RANGE [0,10]

Master Script:
IF RNDOPEN THEN
OPENRAND=INT(RND(10))
PARAMETERS gs_open_3D=90*NOT(OPENRAND>=RNDPROB)
PARAMETERS gs_shut_open=1*(OPENRAND>=RNDPROB)
ENDIF

Sorry for the unformated code