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

Attributes

[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.

See also IND function description in the “Miscellaneous” > “Requests” on page 242.

INLINE ATTRIBUTE DEFINITION

Attributes in can be created using the material, fill and line type dialog boxes. These floor plan attributes can be referenced from any GDL script. Attributes can also be defined in GDL scripts. There are two different cases:

Attribute definition in the MASTER_GDL script. The MASTER_GDL script is interpreted when the library that contains it is loaded in the memory. The MASTER_GDL attributes are merged into the floor plan attributes; attributes with the same names are not replaced. Once the MASTER_GDL is loaded, the attributes defined in it can be referenced from any script.

Attribute definition in library parts. The materials and textures defined this way can be used in the script and its second generation scripts. Fills and line types defined and used in the 2D script have the same behavior as if they were defined in the MASTER_GDL script.

The Check GDL Script command in the script window helps to verify whether the material, fill, line type or style parameters are correct.

When a material, fill, line type or style is different in the 3D interpretation of the library part from the intended one, but there is no error message, this probably means that one or more of the parameter values are incorrect. The Check GDL Scripts command will help you with detailed messages to find these parameters.

Materials

DEFINE MATERIAL

DEFINE MATERIAL name type, parameter1, parameter2, ... parametern

Note: This command can contain additional data definition.

See “Additional Data” on page 177 for details.

Any GDL script can include material definitions prior to the first reference to that material name. This material can only be used for 3D elements in its own script and its second generation scripts.

160

ArchiCAD 11 GDL Reference Guide

Attributes

name: name of the material.

type: type of the material. The actual number (n) of parameters that define the material is different, depending on the type. The meaning of the parameters and their limits are explained in the examples’ comments.

0:general definition, n=16

1:simple definition, n=9 (extra parameters are constants or calculated from given values)

2-7: predefined material types, n=3

The three values are the RGB components of the surface color. Other parameters are constants or calculated from the color.

2:matte

3:metal

4:plastic

5:glass

6:glowing

7:constant

10:general definition with fill parameter, n=17

11:simple definition with fill parameter, n=10

12-17: predefined material types with fill parameter, n=4

20:general definition with fill, color index of fill and index of texture parameters, n=19

21:simple definition with fill, color index of fill and index of texture parameters, n=12

22-27: predefined material types with fill, color index of fill and index of texture parameters, n=6

Special meanings for types 20-27:

If the pen number is zero, vectorial hatches will be generated with the active pen.

Zero value for a texture index allows you to define materials without a vectorial hatch or texture.

Examples:

DEFINE MATERIAL "water" 0, 0.5284, 0.5989, 0.6167,

!surface RGB [0.0..1.0] 1.0, 0.5, 0.5, 0.9,

!ambient, diffuse, specular,transparent

!coefficients [0.0..1.0]

2.0,

! shining [0.0..100.0] 1,

ArchiCAD 11 GDL Reference Guide

161

Attributes

!transparency attenuation [0.0..4.0] 0.5284, 0.5989, 0.6167,

!specular RGB [0.0..1.0]

0, 0, 0,

!emission RGB [0.0..1.0] 0.0

!emission attenuation [0.0..65.5]

DEFINE MATERIAL "asphalt" 1,

0.1995, 0.2023, 0.2418,

!surface RGB [0.0..1.0] 1.0, 1.0, 0.0, 0.0,

!ambient, diffuse, specular,transparent

!coefficients [0.0..1.0]

0,

!shining [0..100] 0

!transparency attenuation [0..4]

DEFINE MATERIAL "matte red" 2, 1.0, 0.0, 0.0

!surface RGB [0.0..1.0]

DEFINE MATERIAL "Red Brick" 10, 0.878294, 0.398199, 0.109468, 0.58, 0.85, 0.0, 0.0, 0, 0.0,

0.878401, 0.513481, 0.412253, 0.0, 0.0, 0.0, 0,

IND(FILL, "common brick")

!fill index

DEFINE MATERIAL "Yellow Brick+*" 20,

1, 1, 0,

!surface RGB [0.0 .. 1.0]

0.58, 0.85, 0, 0,

!ambient, diffuse, specular,transparent

!coefficients [0.0 .. 1.0]

0,

!shining [0.0 .. 100.0] 0,

!transparency attenuation [0.0 .. 4.0]

0.878401, 0.513481, 0.412253,

!specular RGB [0.0 .. 1.0] 0, 0, 0,

!emission RGB [0.0 .. 1.0]

162

ArchiCAD 11 GDL Reference Guide

Attributes

0,

!emission attenuation [0.0 .. 65.5] IND(FILL, "common brick"), 61, IND(TEXTURE, "Brick")

!Fill index, color index, texture index

DEFINE MATERIAL BASED_ON

DEFINE MATERIAL name [,] BASED_ON orig_name [,] PARAMETERS name1 = expr1 [, ...][[,] ADDITIONAL_DATA name1 = expr1 [, ...]]

Material definition based on an existing material. Specified parameters of the original material will be overwritten by the new values, other parameters remain untouched. Using the command without actual parameters results in a material exactly the same as the original, but with a different name. Parameter values of a material can be obtained using the “REQUEST{2} ("Material_info", name_or_index, param_name, value_or_values)” function.

orig_name: name of the original material (name of an existing, previously defined in GDL or floor plan material)

namei: material parameter name to be overwritten by a new value. Names corresponding to parameters of material definition:

gs_mat_surface_r, gs_mat_surface_g, gs_mat_surface_b (surface RGB [0.0..1.0]) gs_mat_ambient (ambient coefficient [0.0..1.0])

gs_mat_diffuse (diffuse coefficient [0.0..1.0]) gs_mat_specular (specular coefficient [0.0..1.0]) gs_mat_transparent (transparent coefficient [0.0..1.0]) gs_mat_shining (shininess [0.0..100.0]) gs_mat_transp_att (transparency attenuation [0.0..4.0])

gs_mat_specular_r, gs_mat_specular_g, gs_mat_specular_b (specular color RGB [0.0..1.0]) gs_mat_emission_r, gs_mat_emission_g, gs_mat_emission_b (emission color RGB [0.0..1.0]) gs_mat_emission_att (emission attenuation [0.0..65.5])

gs_mat_fill_ind (fill index) gs_mat_fillcolor_ind (fill color index) gs_mat_texture_ind (texture index)

expri: new value to overwrite the specified parameter of the material. Value ranges are the same as at the material definition.

ArchiCAD 11 GDL Reference Guide

163