I’m writing a python script to import a file and set imported layers to a new parent layer. In order to avoid imported objects from being inserted on an existing layers, the process is to temporarily rename existing layers, import, move new layers to new parent layer, and the revert the temp name.
This works great but undoing does not revert the original layers back to the original layer names, as pointed out in this thread: https://discourse.mcneel.com/t/problems-with-multiple-layer-naming-in-one-command/38502/2
Is there a better way to work around this bug? I think another method might be to move all imported objects that get put into existing layers back onto new layers, but that seems overly complicated, especially if blocks are involved. Thoughts?