Damned ! I haven't rights to create mesh in an exporter plug in ! Why this restriction

I wanted to create copy of my multi-material shape (as many copy as number of materials) and delete faces which were not with the same material... I cannot... How to do circumvent this restriction ?

An other question : how to delete a mesh ? Delete functions for faces, edges, points exist but for a whole mesh ??