Boolean difference


hi . I am new to python and trying to learn about it and could use some help. I’m trying to solve a problem about multiple Boolean differences that don’t all intersect. So i have 6 boxes: 3 running long in the x axis and three in the y and they don’t all intersect each other… I wrote a script to Boolean difference them but its not working like i want it to . I included a rhino result that id like to achieve in the file. THX -ethan

import rhinoscriptsyntax as rs

b1 = []
for i in range(b1L):
b1.append (x)
print b1
bb= len(b1)
print bb
b2 = []
for j in range(b2L):
b2.append (y)
print b2
bc = len(b2)
print bc

def bool ():
for i in range (bb):
for j in range(bc):
a = rs.BooleanDifference( b1,b2, False)
return (a)
a = bool ()

boolean_test_01.3dm (622.6 KB) (12.6 KB)


with the help of djordje from the grasshopper forum we figured out that the gh python input needed to be set to list access instead of item access! then the script is much simpler:

import rhinoscriptsyntax as rs

a = rs.BooleanDifference(x, y, False)

Im not sure the difference between item access , list access and tree access? any one able to clarify? THX- e