Trim with region not working?

Hi! does anyone know what might be happening with my definition? I can’t trim this lines with the polyline. Thank you!

trim with region not working.gh (28.3 KB)

Don’t flatten the curve input. You should care about the data tree.
And when your lines lie on the boundary edges, It’ll be likely to fail in some cases.

Thank you so much!!! But what about this lines that are outside the region? How can I delete them or cull them?

As I already mentioned…

Great! Thank you so much