Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Groups & SOE within Loops

Anonymous
Not applicable
Hi there,

I am creating a pile layout & want the piles to cut away the footings.
I can do this easily within the script using groups, & a operation but it doesnt work within the loop:

The Solid Operation works fine on the first pile but none of the others show up. Do I need to put the group/ Subgroup elsewhere?

ie:

FOR k = 0 TO A STEP pileCentres
ADDX k
GOSUB 100:
NEXT k

END

100: ! Piles
GROUP 'Pile' !!!!Group for Solid operation
BLOCK pileSize, pileSize, pileFootingDeptht
ENDGROUP

GROUP 'Footing'
BLOCK footingSize, footingSize, footingDepth
ENDGROUP

subtractedFooting = SUBGROUP('Footing', 'Pile')
finished = SUBGROUP(subtractedFooting, 'Pile')
PLACEGROUP finished

KILLGROUP 'Footing'
KILLGROUP 'Pile'
KILLGROUP finished


RETURN

Please Help!! thanks!!
2 REPLIES 2
rocorona
Booster
Group names can't be reused in the same script. not even if previously killed.

This one works for me:
DIM subtractedFooting [] 
DIM finished[] 
 
GROUP 'Pile' !!!!Group for Solid operation  
BLOCK pileSize, pileSize, pileFootingDeptht  
ENDGROUP  
 
GROUP 'Footing'  
BLOCK footingSize, footingSize, footingDepth  
ENDGROUP  
 
FOR k = 0 TO A STEP pileCentres  
ADDX k  
GOSUB 100:  
NEXT k  
KILLGROUP 'Footing'  
KILLGROUP 'Pile'  
 
END  
 
100: ! Piles  
 
subtractedFooting[k+1] = SUBGROUP('Footing', 'Pile')  
finished[k+1] = SUBGROUP(subtractedFooting[k+1], 'Pile')  
PLACEGROUP finished [k+1] 
 
KILLGROUP finished [k+1] 
 
RETURN  
 


But, if elements are all the same, why not simply repeat the placement?
i.e., after defining the groups:
FOR k = 0 TO A STEP pileCentres 
PLACEGROUP finished 
ADDx k 
NEXT k
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Hello Roberto

Thank you very much for your advice & help,

after a bit of playing around I got the second method to work!!

I dont think the code is 100% efficient right nowm, but its working & i will fine tune.

thanks again!