Looking for a way to make python code work with multiple input points

hey everyone,
the code now subtracts the sphere from the cube with one point and one radius. I tried to make it work with a list of points and radiuses coming from the same input as in the photos but with no successes. is it possible to make the command DistanceTo run on variable lists? what’s the best method to code such operation? still very new to python. any help will be great!



substract from cubes with spheres.gh (15.0 KB)

Works fine with ‘tOf’ toggle set to false.


cubes with spheres_2023Jan19a.gh (10.7 KB)

I think I got it? List Access for ‘iPoint’ and ‘iRadius’.


cubes with spheres_2023Jan19bb.gh (9.7 KB)

planes = []

for i in range(10):    #making a loop that makes a row on x 
    
    for j in range(10):     #making a loop that makes a row on y 
        
        for q in range(10):    #making a loop that makes rows on z 
            point = rg.Point3d(i*size,j*size,q*size)  #making points with i(x) j(y) and q(z) 

            inCircle = False
            for k in range(len(iPoint)):
                inCircle = inCircle or pointInCircle(point,iPoint[k],iRadius[k])

            if inCircle == tOf:  #substract def
                plane = rg.Plane(point, rg.Vector3d.ZAxis) #making a plane for every point thats here normal is the z axis
                planes.append(plane) 

boxes = visualBoxs(planes) #final visual function

hi joseph yes that’s exactly what I was heading for! thanks a lot that really helped!