Remove surface boundaries

Hi everyone. I’ve created a script to add a single boundary to a existing surface and it works (Thanks Camber).

But I can´t find a way to remove all of the surface boundaries before adding the new boundary. Seems there’s no node for that. I hope you can give me ideas. I think there should be a way using Python but I’m not sure in how to use the API. Thanks in advance.