GDL
About building parametric objects with GDL.
SOLVED!

I'd like to sum the thickness of the two complexes into one

soo
Contributor

soo_0-1664439770735.png

I'm developing a skin label.

and feel little bit difficult to sum the thicknesses of the two complexes into one.

I mean if they are same type of complex, make sum the thickness together.

soo_1-1664440115258.png

 

for example, I wanna get the label display "THK 200.0 GENERIC - INTERNAL CLADDING".

 

 

I put this in 2D script. and then I got 2 error messages .

 

1.PNG

2.PNG

 

 

how can I solve this problem? I'm happy to someone reply that.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hey Soo, now I understand. You need to check for adjacent BMATs that are the same, and not for skin types.

But again, your code does not work, because you are running out of bounds of the array.

 

Do something like this:

dim thk_added_skins[]
k=1 ! current skin number
j=1 ! simple counter for inner while
i=1 ! counter skin type, thk array 
while (k <= WALL_SKINS_NUMBER) do
	thk_added_skins[i] = WALL_SKINS_PARAMS[k][2]
	while 	(k+j <= WALL_SKINS_NUMBER) &\
			(WALL_SKINS_PARAMS[k][18] = WALL_SKINS_PARAMS[k+j][18]) \
	do
		thk_added_skins[i] = thk_added_skins[i] + WALL_SKINS_PARAMS[k+j][2]
		j=j+1 	! check next one
	endwhile
	k=k+j 	! next skin number to check
	j=1 	! reset counter of inner while
	i=i+1 	! next group of type 
endwhile

 

 

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

3 REPLIES 3
runxel
Legend

Now there is something to know about Archicad composite walls:
You can't have "two" or more cores (That's why setting the reference line according to the core works), but you can have none at all. Skins set to "core" (in opposition to "finish" and "other") must be adjacent.
Also be reminded that the global "WALL_SKINS_PARAMS" will list the skins from outside to inside.
The last "core" skin (if one is defined as such) will have the core status set to "3", the other ones will be "1". You can't differentiate between "finish" and "other" as far as I can see.

 

I am not sure why you would need to add those claddings, I probably would have found it more interesting to see "outer skins thicknes – core thickness – inner skins thickness", but what you want is really easy to achieve.

You have to explicitely check the bounds of an array. For us this number lives already in the WALL_SKINS_NUMBER global.
Also, because a wall could have up to 127 skins, you should do your calculations in a loop.

thk_non_core_skins = 0.0
for i=1 to WALL_SKINS_NUMBER
  if WALL_SKINS_PARAMS[i][6] = 0 then
    thk_non_core_skins = thk_non_core_skins + WALL_SKINS_PARAMS[i][2]
  endif
next i

 

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

sometimes I need to put wire mesh line between concrete at skin complex menu for cross section expression.

 2222.PNG111.PNG

So in this picture, actually the concrete's thickness is 70mm.

but when I use a label object, that can express only 35mm.

that's why I wanna get sum 2 skin complex's thickness into 1.

and I wanna make them automatically.

 

 I put this one into <2D Script> but it's not working.

for n=1 to WALL_SKINS_NUMBER

if stFinish[n] = stFinish[n+1] then
thkFinish[n] = thkFinish[n] + thkFinish[n+1]
endif

next n

 

thanks for your reply.

Soo.

Solution

Hey Soo, now I understand. You need to check for adjacent BMATs that are the same, and not for skin types.

But again, your code does not work, because you are running out of bounds of the array.

 

Do something like this:

dim thk_added_skins[]
k=1 ! current skin number
j=1 ! simple counter for inner while
i=1 ! counter skin type, thk array 
while (k <= WALL_SKINS_NUMBER) do
	thk_added_skins[i] = WALL_SKINS_PARAMS[k][2]
	while 	(k+j <= WALL_SKINS_NUMBER) &\
			(WALL_SKINS_PARAMS[k][18] = WALL_SKINS_PARAMS[k+j][18]) \
	do
		thk_added_skins[i] = thk_added_skins[i] + WALL_SKINS_PARAMS[k+j][2]
		j=j+1 	! check next one
	endwhile
	k=k+j 	! next skin number to check
	j=1 	! reset counter of inner while
	i=i+1 	! next group of type 
endwhile

 

 

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»