GDL
About building parametric objects with GDL.
SOLVED!

Is it possible to use "GET" in SPRISM with numeric and alfanumeric values?

Mario Sacco
Expert

I have complex polygons managed as data using PUT.

In SPRISM we have multiple variables type: numeric and alfanumeric (material).

I need alfanumeric material due to the fact the Material (surface) is created in GDL and we can't extract an ID from a Material created in GDL using "IND (MATERIAL, name_string)"

 

PUT doesn't manage alfanumeric values.

 

Is there a way to insert multiple data (numeric and alfanumeric) in FPRISM with only one command such us "GET"?

I tried also to understand if "DICT" could work; but it seams it can't be used in SPRISM.

 

Thank you

 

 

 

 

 

SPRISM_{4} top_material, bottom_material, side_material, mask,
 n,
 xtb, ytb, xte, yte, topz, tangle,
 xbb, ybb, xbe, ybe, bottomz, bangle,
 x1, y1, s1, mat1,
 ...
 xn, yn, sn, matn

!-------Example with "GET" but it doesn't work----
SPRISM_{4} top_material, bottom_material, side_material, mask,
 n,
 xtb, ytb, xte, yte, topz, tangle,
 xbb, ybb, xbe, ybe, bottomz, bangle,
GET(NSP)

 

 

 

 

MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Pertti Paasky
Expert

Try this.

I found out that if You put  mat_1,mat_1, mat_2, mask, n ... it does not work. There should be at least 2 material definition for some reason.

!Inline material definitions
colorname="color_1"
define material colorname 2,.5,.5,.1
colorname="color_2"
define material colorname 2,.1,.5,.1
colorname="color_3"
define material colorname 2,.1,.5,.6
colorname="color_4"
define material colorname 2,.6,.1,.6
colorname="color_5"
define material colorname 2,.6,.1,.1

mat_1=IND (MATERIAL, "color_1")
mat_2=IND (MATERIAL, "color_2")
mat_3=IND (MATERIAL, "color_3")
mat_4=IND (MATERIAL, "color_4")
mat_5=IND (MATERIAL, "color_5")


j1=1!: top edge in line elimination.
j2=1!: bottom edge in line elimination.
j3=1!: side edge in line elimination.
mask = j1 + 2*j2 + 4*j3 + 8*j4


put 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 0, 0,
0, 0, 15, mat_1,
1, 0, 15, mat_2,
1, 1, 15, mat_3,
0, 1, 15, mat_4,
0, 0, -1, mat_5


SPRISM_{4} mat_1,mat_1, mat_2, mask, (nsp-12)*.25, get(nsp)

- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

View solution in original post

2 REPLIES 2
Solution
Pertti Paasky
Expert

Try this.

I found out that if You put  mat_1,mat_1, mat_2, mask, n ... it does not work. There should be at least 2 material definition for some reason.

!Inline material definitions
colorname="color_1"
define material colorname 2,.5,.5,.1
colorname="color_2"
define material colorname 2,.1,.5,.1
colorname="color_3"
define material colorname 2,.1,.5,.6
colorname="color_4"
define material colorname 2,.6,.1,.6
colorname="color_5"
define material colorname 2,.6,.1,.1

mat_1=IND (MATERIAL, "color_1")
mat_2=IND (MATERIAL, "color_2")
mat_3=IND (MATERIAL, "color_3")
mat_4=IND (MATERIAL, "color_4")
mat_5=IND (MATERIAL, "color_5")


j1=1!: top edge in line elimination.
j2=1!: bottom edge in line elimination.
j3=1!: side edge in line elimination.
mask = j1 + 2*j2 + 4*j3 + 8*j4


put 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 0, 0,
0, 0, 15, mat_1,
1, 0, 15, mat_2,
1, 1, 15, mat_3,
0, 1, 15, mat_4,
0, 0, -1, mat_5


SPRISM_{4} mat_1,mat_1, mat_2, mask, (nsp-12)*.25, get(nsp)

- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Mario Sacco
Expert

Fantastic, it works fine.

I thought the negative value was an indication of error; instead it is a real ID of the internal Material.

 

Thank you @Pertti Paasky 

I solved many problems and I will have a large amount of flexibility for future codes!!

MacBook M1 Max 64GB- OS X 12.2.1 - Archicad 27
https://www.archiradar.it/en/

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!