2022-06-14 04:00 PM - last edited on 2022-06-17 04:37 AM by Laszlo Nagy
Is it possible to use not materials index, but kinda its name (pre-defined materials in gdl has names, not index) basically for all shapes with prism_, tube and so on ?
define material 'purple' 2, 1, 0, 1
define material 'white' 2, 1, 1, 1
material 'purple'
mat1=10 ! black
pen 1
_si=15
block 1,1,1
add 2, 2, 0
cprism_{3} 'white' , 'white' , 'white' , 0,
5, 2,
0, 0, 0, _si, mat1,
0, 1, 0, _si, mat1,
1, 1, 0, _si, mat1,
1, 0, 0, _si, mat1,
0, 0, 0, -1, mat1
add 2, 2, 0
material 'white'
mat2=76 ! green
mat3=78 ! yellow
cprism_{3} 'purple', 'purple', 'purple', 0,
5, 2,
0, 0, 0, _si, mat3,
0, 1, 0, _si, mat3,
1, 1, 0, _si, mat3,
1, 0, 0, _si, mat3,
0, 0, 0, -1, mat3
add 2,2, 0
block 1,1,1
Solved! Go to Solution.
2022-06-15 08:16 AM - last edited on 2022-06-17 04:37 AM by Laszlo Nagy
Hi A_Smith,
No a numerical expression is required for mat1, mat2 and mat3 variable,
but you can easily set them with the IND command :
define material 'purple' 2, 1, 0, 1
define material 'white' 2, 1, 1, 1
mat1 = IND (MATERIAL, 'purple')
mat3 = IND (MATERIAL, 'white')
_si=15
pen 1
cprism_{3} 'white' , 'white' , 'white' , 0,
5, 2,
0, 0, 0, _si, mat1,
0, 1, 0, _si, mat1,
1, 1, 0, _si, mat1,
1, 0, 0, _si, mat1,
0, 0, 0, -1, mat1
add 2, 2, 0
cprism_{3} 'purple', 'purple', 'purple', 0,
5, 2,
0, 0, 0, _si, mat3,
0, 1, 0, _si, mat1,
1, 1, 0, _si, mat3,
1, 0, 0, _si, mat1,
0, 0, 0, -1, mat3
2022-06-15 08:16 AM - last edited on 2022-06-17 04:37 AM by Laszlo Nagy
Hi A_Smith,
No a numerical expression is required for mat1, mat2 and mat3 variable,
but you can easily set them with the IND command :
define material 'purple' 2, 1, 0, 1
define material 'white' 2, 1, 1, 1
mat1 = IND (MATERIAL, 'purple')
mat3 = IND (MATERIAL, 'white')
_si=15
pen 1
cprism_{3} 'white' , 'white' , 'white' , 0,
5, 2,
0, 0, 0, _si, mat1,
0, 1, 0, _si, mat1,
1, 1, 0, _si, mat1,
1, 0, 0, _si, mat1,
0, 0, 0, -1, mat1
add 2, 2, 0
cprism_{3} 'purple', 'purple', 'purple', 0,
5, 2,
0, 0, 0, _si, mat3,
0, 1, 0, _si, mat1,
1, 1, 0, _si, mat3,
1, 0, 0, _si, mat1,
0, 0, 0, -1, mat3
2022-06-15 09:03 AM
Thank you