Directives


The influence of directives on the interpretation of the subsequent GDL statements remains in effect until the next directive or the end of the script.
Called scripts inherit the current settings: the changes have local influence. Returning from the script resets the settings as they were before the macro call.

Directives for 3D and 2D Scripts

LET

[LET] varnam = n

Value assignment. The LET directive is optional. The variable will store the evaluated value of n.

RADIUS

RADIUS radius_min, radius_max

Sets smoothness for cylindrical elements and arcs in polylines.

A circle with a radius of r is represented:

  • if r < radius_min, by a hexagon,
  • if r >= radius_max, by a 36-edged polygon,
  • if radius_min < r < radius_max, by a polygon of
    (6+30*(r-radius_min)/(radius_max-radius_min)) edges.

Arc conversion is proportional to this.

After a RADIUS statement, all previous RESOL and TOLER
statements lose their effect.

r_min <= r_max

Example:

RADIUS 1.1, 1.15
CYLIND 3.0, 1.0
RADIUS 0.9, 1.15
CYLIND 3.0, 1.0
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_radius_ex1.png
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_radius_ex2.png

RESOL

RESOL n

Sets smoothness for cylindrical elements and arcs in polylines. Circles are converted to regular polygons having n sides.

Arc conversion is proportional to this.

After a RESOL statement, any previous RADIUS and TOLER statements lose their effect.

n >= 3

Default:

RESOL 36

Example:

RESOL 5
CYLIND 3.0, 1.0
RESOL 36
CYLIND 3.0, 1.0
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_resol_ex1.png
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_radius_ex2.png

TOLER

TOLER d

Sets smoothness for cylindrical elements and arcs in polylines.
The error of the arc approximation (i.e., the greatest distance between the theoretical arc and the generated chord) will be smaller than d.

After a TOLER statement, any previous RADIUS and RESOL statements lose their effect.

Example:

TOLER 0.1
CYLIND 3.0, 1.0
TOLER 0.01
CYLIND 3.0, 1.0
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_toler_ex1.png
https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_radius_ex2.png

Note

The RADIUS, RESOL and TOLER directives set smoothness for cylindrical 3D elements
(CIRCLE, ARC, CYLIND, SPHERE, ELLIPS, CONE, ARMC, ARME, ELBOW, REVOLVE) and arcs in 2D polylines using curved edges.


See the section called “Additional Status Codes”.

PEN

PEN n

Sets the color.

0 < n <= 255

Default:

PEN 1

if there is no PEN statement in the script.

(For library parts, default values come from the library part’s settings.
If the script refers to a non-existing index, PEN 1 becomes the default setting.)

LINE_PROPERTY

LINE_PROPERTY expr

Defines the property for all subsequently generated lines in the 2D script (RECT2, LINE2,
ARC2, CIRCLE2,
SPLINE2, SPLINE2A,
POLY2, FRAGMENT2 commands)
until the next LINE_PROPERTY statement. Default value is generic.

expr: possible values:
0: all lines are generic lines,
1: all lines are inner,
2: all lines are contour.

[SET] STYLE

[SET] STYLE name_string
[SET] STYLE index

All the texts generated afterwards will use that style until the next SET STYLE statement.

The index is a constant referring to a style stack in the internal data structure
(negative indices mean indices in the data structure of inline materials (previously defined in the GDL script)).
This stack is modified during GDL analysis and can also be modified from within the program.
The use of the index instead of the style name is only recommended with the prior use of the IND function.

Default:

SET STYLE 0

(application font, size 5 mm, anchor = 1, normal face) if there is no SET STYLE statement in the script.

Directives Used in 3D Scripts Only

MODEL

MODEL WIRE
MODEL SURFACE
MODEL SOLID

Sets the representation mode in the current script.

MODEL WIRE: only wireframe, no surfaces or volumes. Objects are transparent.

MODEL SURFACE, MODEL SOLID: The generation of the section surfaces is based on the relation of the boundary surfaces,
so that both methods generate the same 3D internal data structure. Objects are opaque.

The only distinction can be seen after cutting away a part of the body:

MODEL SURFACE: the inside of bodies will be visible,

MODEL SOLID: new surfaces may appear.

Default:

MODEL SOLID

 

Example:
To illustrate the three modeling methods, consider the following three blocks:

MODEL WIRE
BLOCK 3,2,1
ADDY 4
MODEL SURFACE
BLOCK 3,2,1
ADDY 4
MODEL SOLID
BLOCK 3,2,1

After cutting them with a plane:

https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_model.png

 

[SET] MATERIAL

[SET] MATERIAL name_or_index

 


All the surfaces generated afterwards will represent that material until the next MATERIAL statement.
Surfaces in the
BPRISM_,
CPRISM_,
FPRISM_,
HPRISM_,
SPRISM_,
CSLAB_,
CWALL_,
BWALL_,
XWALL_,
CROOF_,
MASS,
bodies are exceptions to this rule.

The index is a constant referring to a material stack in the internal data structure
(negative indices mean indices in the data structure of inline materials (previously defined in the GDL script)).
This stack is modified during GDL analysis and can also be modified from within the program.
The use of the index instead of the material name is only recommended with the prior use of the IND function.

index 0 has a special meaning: surfaces use the color of the current pen and they have a matte appearance.

Default:

MATERIAL 0

if there is no MATERIAL statement in the script.

(For Library parts, default values are read from the Library part’s settings.
If the script refers to a non-existing index, MATERIAL 0 becomes the default setting.)

[SET]BUILDING_MATERIAL

[SET] BUILDING_MATERIAL name_or_index
	[, cut_fill_pen [, cut_fill_bkgd_pen, [iOverrideFlag]]]

Compatibility: introduced in ARCHICAD 21.

All the shapes generated afterwards will represent the surface, cut fill type (in Section/Elevation), foreground and background pens of the set building material.

cut_fill_pen: custom cut fill foreground pen index to override the index of the active building material attribute
cut_fill_bkgd_pen: ustom cut fill background pen index to override the index of the active building material attribute
iOverrideFlag: enable “cut_fill_pen” and/or “cut_fill_bkgd_pen” to take effect
iOverrideFlag = j1 + 2*j2: , where each j can be 0 or 1.
j1: Override cut fill foreground pen with cut_fill_pen
j2: Override cut fill background pen with cut_fill_bkgd_pen

Override parameters are optional: if the “iOverrideFlag” is not set, or the DEFAULT keyword is used in any of the override pen index parameters, the building material attributes will take effect.

Overriding the cut fill background pen

BUILDING_MATERIAL buildingMatIndex, DEFAULT, cut_fill_bkgd_pen

All the surfaces generated afterwards will represent the surface of the building material until the next
BUILDING_MATERIAL, MATERIAL, SECT_FILL or SECT_ATTRS statement.
Surfaces in the
BPRISM_,
CPRISM_,
FPRISM_,
HPRISM_,
SPRISM_,
CSLAB_,
CWALL_,
BWALL_,
XWALL_,
CROOF_,
MASS,
bodies are exceptions to this rule.

In Section/Elevation, the displayed cut fill foreground and background pens will match the same attributes of the building material (or the override parameters set in the command itself), until the next BUILDING_MATERIAL, MATERIAL, SECT_FILL or SECT_ATTRS statement.

A previous BUILDING_MATERIAL statement has no further control of shapes generated after using SECT_FILL or SECT_ATTRS statements.
Shapes generated after using the following statements keep their BUILDING_MATERIAL settings:
the MATERIAL statement overrides only the surfaces of the generated shape,
the SECT_ATTRS{2} statement controls the representation of the contour pen and line type in section view only,
while the rest of the attributes are still controlled the building material itself.

The index is a constant referring to a building material stack in the internal data structure.
The use of the index instead of the building material name is only recommended with the prior use of the IND function.

index 0 has a special meaning: the generated section eliminates the lines based on the fills.

Default:

BUILDING_MATERIAL 0

if there is no BUILDING_MATERIAL statement in the script.

(For Library parts, default values are read from the Library part’s settings.
If the script refers to a non-existing index, BUILDING_MATERIAL 0 becomes the default setting.)

SECT_FILL

SECT_FILL fill, fill_background_pen,
        fill_pen, contour_pen

or

SECT_ATTRS

SECT_ATTRS fill, fill_background_pen,
        fill_pen, contour_pen [, line_type]

Defines the attributes used for the cut part of the 3D elements in the Section/Elevation window. Compatibility: up to ARCHICAD 19 the PROJECT2{3} command is affected too. Inline fill and line_type attributes (defined in master script or 3d script) are not accepted.

fill: fill name or index number.
fill_background_pen: fill background pencolor number.
fill_pen: fill pencolor number.
contour_pen: fill contour pencolor number.
line_type: line type of polygon edges.

SECT_ATTRS{2}

SECT_ATTRS{2}contour_pen [, line_type]

Compatibility: introduced in ARCHICAD 21.
Defines the contour pen and line type used for the cut part of the 3D elements in Section/Elevation. Can be combined with BUILDING_MATERIAL statement for handling all of the Section/Elevation attributes. Inline line_type attribute (defined in master script or 3d script) is not accepted.

contour_pen: fill contour pencolor number.
line_type: line type of polygon edges.

SHADOW

SHADOW casting [, catching]

Controls the shadow casting of the elements in
PhotoRendering and in vectorial shadow casting.

casting: ON, AUTO or OFF
ON: all the subsequent elements will cast shadows in all circumstances,
OFF: none of the subsequent elements will cast shadows in any circumstance,
AUTO: shadow casting will be determined automatically

Setting SHADOW OFF for hidden parts will spare memory space and processing time.

Setting SHADOW ON ensures that even tiny details will cast shadows.

catching: ON or OFF

This optional parameter controls the appearance of shadows (from other bodies) on surfaces.

If shadow casting isn’t specified, the default will be AUTO.

Example:

 

https://gdl.graphisoft.com/wp-content/uploads/ac19-gdl/Attributes_shadow.png
SHADOW OFF
! horizontal surface
PRISM 4, 0.2,
      0, 0,
      6, 0,
      6, 6,
      0, 6

ADDX 0.5
ADDY 2.5

BRICK 1, 1, 1
ADDX 2
SHADOW ON
BRICK 1, 1, 2
ADDX 2
SHADOW OFF
BRICK 1, 1, 3

DEL 4

 

 

Directives Used in 2D Scripts Only

DRAWINDEX

DRAWINDEX number

Defines the drawing order of 2D Script elements. Elements with a smaller drawindex will be drawn first.

0 < number <= 50

(In the current version of GDL only the 10, 20, 30, 40 and 50 DRAWINDEX values are valid. Other values will be rounded to these.)

If no DRAWINDEX directive is present, the default drawing order is the following:

1 Figures

2 Fills

3 Lines

4 Text elements

[SET] FILL

[SET] FILL name_string
[SET] FILL index

All the 2D polygons generated afterwards will represent that fill until the next SET FILL statement.

 


The index is a constant referring to a fill stack in the internal data structure.
This stack is modified during GDL analysis and can also be modified from within the program.
The use of the index instead of the fill name is only recommended with the prior use of the IND function.

Default:

SET FILL 0

i.e., empty fill, if there is no SET FILL statement in the script.

[SET] LINE_TYPE

[SET] LINE_TYPE name_string
[SET] LINE_TYPE index

All the 2D lines generated afterwards will represent that line type (in lines, arcs, polylines) until the next SET LINE_TYPE statement.
The index is a constant that refers to a line type stack in the internal data structure.
This stack is modified during GDL analysis and can also be modified from the program.
The use of the index instead of the line type name is only recommended with the prior use of the IND function.

Default:

SET LINE_TYPE 1

i.e., solid line, if there is no SET LINE_TYPE statement in the script.