The Parameter Script


Parameter lists are sets of possible numerical or string values.
They can be applied to the parameters as defined in the Parameter Script of the Library Part, in the _LibraryMaster object or the MASTER_GDL script.
Type compatibility is verified by the GDL compiler.

The Parameter Script will be interpreted each time a value list type parameter value is to be changed,
and the possible values defined in the script will appear in a pop-up menu. For numerical parameters pop-up menu item
values can be defined as strings using the VALUES{2} command.

VALUES

VALUES "parameter_name" [,]value_definition1 [, value_definition2, ...]
VALUES "fill_parameter_name" [[,] FILLTYPES_MASK fill_types], value_definition1
			[, value_definition2, ...]
VALUES "profile_parameter_name" [[,] PROFILETYPES_MASK profile_types], value_definition1
			[, value_definition2, ...]

Defines a value restriction for a parameter (except dictionary type). The command has a special syntax for fill type and profile type parameters. If used on an array parameter, the restriction will be applied to all items individually.

parameter_name: name of an existing parameter
fill_parameter_name: name of an existing fillpattern type parameter
fill_types: 
fill_types = j1 + 2*j2 + 4*j3, where each j can be 0 or 1.
j1cut fills,
j2cover fills,
j3drafting fills.

Can be used for fill-pattern type parameters only.
The fill popup for this parameter will contain only those types of fills which are specified by the bits set to 1.
Default is all fills (0).

profile_parameter_name: name of an existing profile type parameter
profile_types: 
j1wall,
j2beam,
j3column,
j4handrail,
j5other.

Can be set for profile type parameters only.
The value list for any profile type parameter includes all existing profiles of the planfile automatically, no individual VALUES definition is needed.
Using VALUES without masking (0) has the exact same result.
Using VALUES with masking can filter the value list, leaving only the corresponding profiles of the bits set to 1.
Individual profile indexes can be listed as regular value definitions as well.

value_definitioni: value definition, can be:
expression: numerical or string expression, or
CUSTOM: keyword, meaning that any custom value can be entered, or
RANGE: range definition, with optional step

RANGE left_delimiter[lower_limit], [upper_limit]right_delimiter [STEP step_start_value, step_value]

left_delimiter: [, meaning >=, or (, meaning >;
lower_limit: lower limit expression;
upper_limit: upper limit expression;
right_delimiter: ], meaning <=, or ), meaning <;
step_start_value: starting value;
step_value: step value.

VALUES{2}

VALUES{2} "parameter_name" [,]num_expression1, description1,
			[, num_expression2, description2, ...]
VALUES{2} "parameter_name" [,]num_values_array1, descriptions_array1
			[, num_values_array2, descriptions_array2, ...]
parameter_name: name of an existing angle, length, real, or integer type parameter
num_expressioni, num_values_arrayi: 
simple value definition for a numerical parameter, or array expression containing multiple numerical values. Available only for VALUES{2}
descriptioni, descriptions_arrayi: description string of the numerical value i, or array expression containing multiple description strings of
the values defined by num_values_arrayi (array dimensions must match). Available only for VALUES{2}

Example 1:
Simple value lists

VALUES "par1" 1, 2, 3
VALUES "par2" "a", "b"
VALUES "par3" 1, CUSTOM, SIN (30)
VALUES "par4" 4, RANGE(5, 10], 12, RANGE(,20] STEP 14.5, 0.5, CUSTOM

Example 2:
Read all string values from a file for use in a value list

DIM sarray[]
! file in the library, containing parameter data
filename = "ProjectNotes.txt"
ch1 = OPEN ("text", filename, "MODE=RO, LIBRARY")
i = 1
j = 1
sarray[1] = ""
! collect all strings
DO
    n = INPUT (ch1, i, 1, var)
    IF n > 0 AND VARTYPE (var) = 2 THEN
        sarray[j] = var
        j = j + 1
    ENDIF
    i = i + 1
WHILE n > 0
CLOSE ch1
! parameter popup with strings read from the file
VALUES "RefNote" sarray

PARAMETERS

PARAMETERS name1 = expression1 [,
        name2 = expression2, ...,
        namen = expressionn]
namei: the name of the parameter.
expressioni: the new value of the parameter.

Using this command, the parameter values of a Library Part can be modified by the Parameter Script.

The modification will only be effective for the next interpretation. Commands in macros refer to the caller’s parameters.
If the parameter is a value list, the value chosen will be either an existing value, the custom value, or the first value from the value list.

In addition, the global string variable GLOB_MODPAR_NAME contains the name of the last user-modified parameter.

LOCK

LOCK "name1" [, "name2", ..., "namen"]

Locks the named parameter(s) in the settings dialog box.
A locked parameter will appear grayed in the dialog box and its value cannot be modified by the user.

namen: string expression, name of the parameter to be locked.

Compatibility: starting from ARCHICAD 22, the locking/hiding of selected ARCHICAD interface controls is extended.
The extended feature can be activated with “Enable hide/lock of specific fix named optional parameters” setting (see “Details/Compatibility Options” dialog of the object in the Library Part Editor). The extended selection contains fix named optional parameters corresponding to:

LOCK ALL ["name1" [, "name2", ..., "namen"]]

Locks all parameters in the settings dialog box, except those listed after the ALL keyword.

HIDEPARAMETER

HIDEPARAMETER "name1" [, "name2", ..., "namen"]

Hides the named parameter(s) and its child parameters in the settings dialog box.
A parameter hidden using this command in the parameter script will automatically disappear from the parameter list.

namen: string expression, name of the parameter to be hidden.

Compatibility: starting from ARCHICAD 22, the locking/hiding of selected ARCHICAD interface controls is extended. For details, see the LOCK command.

HIDEPARAMETER ALL ["name1" [, "name2", ..., "namen"]]

Hides all parameters and its child parameters in the settings dialog box, except those (and their children) listed after the ALL keyword.