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

Control Statements

END / EXIT

END / EXIT [v1, v2, ..., vn]

End of the current GDL script. The program terminates or returns to the level above. It is possible to use several ENDs or EXITs in a GDL file. If the optional list of values is specified, the current script will pass these return values to its caller.

See the description of receiving returned parameters at “CALL” on page 218.

BREAKPOINT

BREAKPOINT expression

With this command, you can specify a breakpoint in the GDL script. The GDL debugger will stop at this command if the value of the parameter (a numeric expression) is true (1) and the Enable Breakpoints option of the debugger is checked. In “normal” execution mode, the GDL interpreter simply steps over this command.

PARAMETER BUFFER MANIPULATION

The parameter buffer is a built-in data structure that may be used if some values (coordinates, for example) change after a definite rule that can be described using a mathematical expression. This is useful if, for instance, you want to store the current values of your variables.

The parameter buffer is an infinitely long array in which you can store numeric values using the PUT command. The PUT command stores the given values at the end of the buffer. These values can later be used (by the GET and USE commands) in the order in which they were entered (i. e., the first stored value will be the first one used). A GET(n) or USE(n) command is equivalent with n values separated by commas. This way, they can be used in any GDL parameter list where n values are needed.

PUT

PUT expression [ , expression, ...]

Store the given values in the given order in the internal parameter buffer.

GET

GET (n)

Use the next n values from the internal parameter buffer and then disregard them.

214

ArchiCAD 11 GDL Reference Guide

Control Statements

USE

USE (n)

Use the next n values from the internal parameter buffer without deleting them. Following USE and GET functions can use the same parameter sequence.

NSP

NSP

Returns the number of stored parameters in the internal buffer.

ArchiCAD 11 GDL Reference Guide

215

Control Statements

Example for using the parameter buffer:

R=2: B=6: C=4: D=10

N=12

S=180/N

FOR T=0 TO 180 STEP S

PUT R+R*COS(T), C-R*SIN(T), 1 NEXT T

FOR I=1 TO 2

EXTRUDE 3+NSP/3, 0,0,D, 1+16, 0, B, 0,

2*R, B, 0,

USE(NSP), 0, B, 0

MULY -1 NEXT I DEL 1 ADDZ D

REVOLVE 3+NSP/3, 180, 0, 0, B, 0,

2*R, B, 0,

GET(NSP), 0, B, 0

216

ArchiCAD 11 GDL Reference Guide

Control Statements

The full description:

R=2: B=6: C=4: D=10

FOR I=1 TO 2

 

 

EXTRUDE 16, 0,0,D, 1+16,

 

0, B, 0,

 

 

2*R, B, 0,

 

 

2*R, C, 1,

C-R*SIN(15),

1,

R+R*COS(15),

R+R*COS(30),

C-R*SIN(30),

1,

R+R*COS(45),

C-R*SIN(45),

1,

R+R*COS(60),

C-R*SIN(50),

1,

R+R*COS(75),

C-R*SIN(75),

1,

R+R*COS(90),

C-R*SIN(90),

1,

R+R*COS(105),

C-R*SIN(105), 1,

R+R*COS(120),

C-R*SIN(120), 1,

R+R*COS(135),

C-R*SIN(135), 1,

R+R*COS(150),

C-R*SIN(150), 1,

R+R*COS(165),

C-R*SIN(165), 1,

0, B, 1,

 

 

0, B, 0

 

 

MULY -1

 

 

NEXT I

 

 

DEL 1

 

 

ADDZ D

 

 

REVOLVE 16, 180, 0,

 

0, B, 0,

 

 

2*R, B, 0,

 

 

2*R, C, 1,

C-R*SIN(15),

1,

R+R*COS(15),

R+R*COS(30),

C-R*SIN(30),

1,

R+R*COS(45),

C-R*SIN(45),

1,

R+R*COS(60),

C-R*SIN(50),

1,

R+R*COS(75),

C-R*SIN(75),

1,

R+R*COS(90),

C-R*SIN(90),

1,

R+R*COS(105),

C-R*SIN(105), 1,

R+R*COS(120),

C-R*SIN(120), 1,

R+R*COS(135),

C-R*SIN(135), 1,

R+R*COS(150),

C-R*SIN(150), 1,

R+R*COS(165),

C-R*SIN(165), 1,

0, B, 1,

 

 

0, B, 0

 

 

ArchiCAD 11 GDL Reference Guide

217