Undo when it sends to the default layer

Greetings to all,

In Rhino 6, I save the line to a layer. What is the reason for undoing the line and assigning it to the default layer?

You have posted in the Rhino Developer category, so I assume you do this in code? If my assumption is correct, can you share your code?