Group curves by region/surface

Hello everyone.

I am trying to write a code in which I can make groups of curves depending on whether they are within a given region.

In this case for example I have a group of curves that are on top of a surface that has been divided in 4. I need to separate in 4 groups the curves by quadrants.

I have tried a few things but I was just getting too complicated, surely there is a nice way to do it.

Thank you very much.

group curves by (9.2 KB)

group curves by (11.6 KB)

Thanks @Rajeev2

Do you think there is a way to group curves that are between two quadrants, depending on the amount of space they occupy in one or the other quadrant?

If you look at the border of the quadrants there are curves that are in the first quadrant but their area occupies much more space in the other quadrant. I would like to be able to make the curves stay in one quadrant by filtering this.

group curves by (16.9 KB)

Sorry, maybe I am not making myself clear. I don’t want to cut the curves I just want to be able to make the curves to be in one quadrant or another by the are they occupy in the quadrants, or if their curve length is greater in one or another.

Maybe it has to be filtered in another way, but as much as I think about it I don’t know how to write it.

group curves by (13.7 KB)

@Rajeev2 Thanks a lot!!