Get brep for checking intersect and performing boolean union

Hi, this question may be very basic and stupid. I am making my own python script to perform boolean operation by first checking intersection.

I have two lists of brep. I want to loop each brep in the first list and check the intersection with another list of breps. Once two breps intersect, store the breps into a new list for later boolean union operation.

After one union step, the brep list will be updated by including the newly unified brep (Don’t know how to update a brep list as well…), then the loop goes to another brep in the first brep list.

However, I don’t know how to “select” the brep in the brep lists using customized python loop. I tried to use index as the following figure, it gave me error: ‘NoneType’ is not subscribable. Please kindly help me with this.

As you can probably see I am working on octet truss geometry. If anyone has a better idea of doing this boolean union operation, please tell me, thank you!!

Right-click over “SphereList” input (in the Python component) and set it as “list access” and type hint > “Brep”.

Thanks, Riccardo. Perfect solution!