@FCort wrote:
....
None of the layers and objects were deleted.
....

The 'nil' there doesn't mean it didn't do anything. If you want it to not show that, you can add a line to the code:
....
); if
(princ); "exit quietly" [read about it in Help]
); defun
....
Again, for me, even without suppressing that 'nil' return, it does remove all objects from such Layers. I thaw the Layers and/or turn them back on and Regenerate, and none of the things I had drawn on them are still there. We could work on getting it to Purge the Layers, too, but first I'd like to solve the problem that it doesn't remove the objects for you, if it really doesn't. But I admit, I don't have any idea where to look for a solution, since I can't duplicate that problem....
Kent Cooper, AIA