propagate selection set when copy/instance objects

Hello,

There is a script that allow to propagate the selection set properties when copy/instance an object?

For example: A box in a selection set named "wall"
when copying/instancing the box, add this copy/instance in the same selection set "wall"

Thanks