Completly erase meshes

I’m progranning a script that creates some meshes and it has a undo button to erase the meshes it creates. The problem is that I use scene.unlink to delete the meshes but there I can’t use again a mesh with the name of the erased one.

¿Is this correct? ¿What should I do in order to be able to use the same name if the script is runed again?


mesh datablocks are “deleted” by not being saved with the file

so if you save/reload they will disappear, but this is probably not what you want your script to do

before unlinking rename your mesh/obj to something else, like myMesh_Deleted.00x

myMesh.00x will thus become available again, no?

Just realized that scene.update() erases th euninked objecjts
Thanks u both.