Modeling
About Archicad's design tools, element connections, modeling concepts, etc.
SOLVED!

Repeating Solid Command in 3D Script

Arnaut_2604
Booster

Hi there,
I've run into the following issue:
I have a complex shelf which I create using INSCTGROUP.

But everytime I place the result, I want to be able to change the thickness of it by defining the Value of Z before placing it. Like you could do with Gosub

 

However it keeps the demensions of the first time I defined Z.

 

Killgroup leaves the Group empty so I don't know how to make this work.

 

The script is just as an example:

for i = 1 to 5
	addz 2
	Gosub "Block":

next i

del top

END

"Block":

	GROUP "Base"
	Block A	,B	,zzyzx+(0.1*i)
	ENDGROUP
	
	GROUP "Operator"
	Rotz 45
	Block A	,B	,zzyzx+(0.1*i)
	del 1
	ENDGROUP
	
	Result = Subgroup("Base", "Operator")
	
	Placegroup Result

RETURN

 


Is there any way to get around this problem?

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
BrunoH
Expert

Hi Arnaut_2604,

 

Within a script each different group shall have a unique name, even if you kill a group you can't reuse it for a new one.

So you have to create a new name for each group.

You can use the i value to do this, see the example modified below.

 

for i = 1 to 5
addz 2
Gosub "Block":
next i
 
del top
 
END
 
"Block":
 
Cible = "Base" + STR (i,1,0)
GROUP Cible
Block A,B,zzyzx+(0.1*i)
ENDGROUP
 
Operateur = "Operator" + STR (i,1,0)
 
GROUP Operateur
Rotz 45
Block A,B,zzyzx+(0.1*i)
del 1
ENDGROUP
 
Resultat = "Result" + STR (i,1,0)
 
Resultat = Subgroup(Cible, Operateur)
 
Placegroup Resultat
 
 
RETURN
ArchiCad 3.43 to 26
MacOS Monterey

View solution in original post

2 REPLIES 2
Solution
BrunoH
Expert

Hi Arnaut_2604,

 

Within a script each different group shall have a unique name, even if you kill a group you can't reuse it for a new one.

So you have to create a new name for each group.

You can use the i value to do this, see the example modified below.

 

for i = 1 to 5
addz 2
Gosub "Block":
next i
 
del top
 
END
 
"Block":
 
Cible = "Base" + STR (i,1,0)
GROUP Cible
Block A,B,zzyzx+(0.1*i)
ENDGROUP
 
Operateur = "Operator" + STR (i,1,0)
 
GROUP Operateur
Rotz 45
Block A,B,zzyzx+(0.1*i)
del 1
ENDGROUP
 
Resultat = "Result" + STR (i,1,0)
 
Resultat = Subgroup(Cible, Operateur)
 
Placegroup Resultat
 
 
RETURN
ArchiCad 3.43 to 26
MacOS Monterey

Brilliant! Thank you!

Didn't know I could make a name which would change with every loop