Notifications
Clear all

[Closed] Boolean for Named Selection Sets?

Is there any special function for boolean between selection sets?

For example, when I subtract the member of selection set A from selection set B.

If there is not a special function, should I use for loop?

3 Replies

you cannot boolean selection sets, or multiple objects in one go.

Attched them together, or use multiple booleans but remember to collapse them between booleans!

BTW you can use


 msh=$myobject1+$myobject2
 

Josh.

*Create two boxes, create a named sel. set "Boxes"
*Create two spheres, create a named sel. set "Spheres"

Now execute:

    array1 = for o in selectionSets["Boxes"] collect o  --collect into an array
    #($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000])
    
    array2 = for o in selectionSets["Spheres"] collect o --collect into another array
    #($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])
    
    join array1 array2 --union!
 #($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])
    
    SelectionSets["Union"] = array1 --create a new sel. set
 #($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])

For Subtraction, go the other way:


 
 array3 = for o in SelectionSets["Union"] collect o --turn sel.set into array
 #($Box:Box01 @ [-31.281609,35.154915,0.000000], $Box:Box02 @ [-71.892082,16.096249,0.000000], $Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])
 
 --for every object in "Boxes" which is also in the Union array3, 
 --delete the item from the array3
 for o in SelectionSets["Boxes"] where findItem array3 o > 0 do deleteItem array3 (findItem array3 o)
 OK
 
 SelectionSets["Union"] = array3 --then assign the reduced array3 to the same sel.set
 #($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])
 
  SelectionSets["UnionMinusBoxes"] = array3 --or create a new sel.set 
 #($Sphere:Sphere02 @ [18.420509,-42.809757,0.000000], $Sphere:Sphere01 @ [24.022360,2.445007,0.000000])
 
 
 

ooh – I see I’ve mis-understood the question! booleans on the brain.

J.