Openinf For MEPF elemnts in walls

I am trying to create an opening for the MEPF model. I don’t know further direction. help me finish it. I have attached the WIP script. Where ever coming nearest MEPF element (near 50 mm) I need one combined opening. Model Penetrations.dyn (88.3 KB)