Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
05 ArchiCAD 11 GDL Reference Guide.pdf
Скачиваний:
58
Добавлен:
11.03.2015
Размер:
3.22 Mб
Скачать

Non-Geometric Scripts

OBJECTS

CEILS PITCHED_ROOFS LIGHTS HATCHES

ROOMS

MESHES

A directive remains valid for all succeeding DESCRIPTORs and COMPONENTs until the next directive is ascribed. A script can include any number of directives.

Example:

DESCRIPTOR "\tPainted box.\n\t Properties:\n\ \t\t - swinging doors\n\

\t\t - adjustable height\n\

\t\t - scratchproof"

 

REF

DESCRIPTOR "0001"

!wardrobe surface

s =

SURFACE3D ()

COMPONENT "glue", 1.5, "kg"

COMPONENT "handle",2*c,"nb"!c number of doors

COMPONENT "paint", 0.5 * s, "kg"

POSITION WALLS

REF COMPONENT "0002"

DRAWING

DRAWING

DRAWING: Refers to the drawing described in the 2D script of the same library part. Use it to place drawings in your bill of materials.

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 or in the MASTER_GDL script. The parameter has to be of simple type. 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.

182

ArchiCAD 11 GDL Reference Guide

Non-Geometric Scripts

VALUES

VALUES "fillparam_name" [[,] FILLTYPES_MASK fill_types,] [,]value_definition1 [, value_definition2, ...]

name: the name of the parameter fill_types = j1 + 2 * j2 + 4 * j3 j1: cut fills

j2: cover fills j3: drafting fills

Can only be used for fill type parameters. If the j bit is set, the fill popup corresponding to the "fillparam_name" parameter will automatically contain only the fills of the specified type. Default is all fills (0).

value_definitioni: value definition, can be:

expressioni: numerical or string expression, or

CUSTOM: keyword, meaning that any custom value can be entered, or

RANGE left_delimiter [expression1], [expression2] right_delimiter [STEP step_start_value, step_value]

range definition, with optional step

left_delimiter: [, meaning ‘>=’, or (, meaning ‘>’ expression1: lower limit expression expression2: upper limit expression

right_delimiter: ], meaning ‘<=’, or ), meaning ‘<‘ step_start_value: starting value

step_value: step value

ArchiCAD 11 GDL Reference Guide

183

Non-Geometric Scripts

Examples:

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 to read all string values from a file

!and use it 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.

184

ArchiCAD 11 GDL Reference Guide