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

Test Parameter Values In Parameter Script?

Anonymous
Not applicable
In the Parameter Script of an object, I tried something similar to the following:

VALUES `Door_Type_Code` `DHG`, `S&R`, `F`, `NL`, `HG`, `FNL`
IF Door_Type_Code = `DHG` THEN
VALUES `Door_Hardware_Code` `1`, `2`, `3`
ELSE
VALUES `Door_Hardware_Code` `10`, `20`, `30`
ENDIF


This apparently fails because `Door_Hardware_Code` isn't initialized at this point. Is there any way to accomplish the task of setting possible values based on another parameter's current value?
11 REPLIES 11
Anonymous
Not applicable
Matthew wrote:
...it requires this kind of stategic placement of code. if you can do that, the objects parameters become much more efficient than anything youll get by coding directly to the master script.
Could you elaborate on that a little bit? Maybe give some examples.
Richard Swann
Booster
david wrote:
My personal reason also has to do with the way I built a Menu.:

mv1="Stationary"
mv2="Moving slowly"
mv3="Moving quickly!"
VALUES "motionmode" mv1,mv2,mv3

Later in the other scripts you can say things like :
IF motionmode=mv3 THEN .........

This method of building menus ONLY works correctly if you do it in the Master Script, because the other scripts will not know what mv1 and mv2 are. As a result of this, I never use the Parameter script except for the very simplest things.
Interesting, I have found no problems using the unsubstituted values from the param script ie:
IF motionmode="Moving slowly" THEN ......... in another script will work fine.
Richard Swann

MacOS 11.7 , Intel Imac 4k ArchiCAD 4.5-27 (Solo)