Openings in created with Dynamo elements

Hi Dynamo Community!

I have the following problem with my Dynamo script:

I’ve created an array of elements inside of a wall. This wall has windows. How can I cut the elements so they will not go through the windows? The elements should end, where a window begins, and start again, where a window ends.

The Revit-family and Dynamo-script are attached.

Thank you!!

Lattung.dyn (88.5 KB) traglattung.rfa (384 KB)
ABG_WIN_Opening-Rectangular_R20.rfa (360 KB)