Strange.. the code is not even supposed to invoke the Layer command. whee did that come from?
EDIT: I see now, it gives that error if none found (the code doesnt include much errorr trapping in testing phase) perhaps enitites on locked layer?
(setq objs (ssget ":L" '((0 . "*LINE,ARC,CIRCLE"))))
(if (> (sslength Dupss) 1)
(command "_chprop" objs "R" Dupss "" "p" "Layer" "Duplicates" "") (princ "\nNo Duplicates Found:"))
You can add this to David's Code
It will create a layer for every Type of Entity Found i.e. If duplicate lines are found it will create
(ssdel en ss))
(if (setq i (sslength (setq objs (eval (read (strcat "S" e))))))
(setq ent_e (entget (ssname objs (setq i (1- i)))))
(entmod (subst (cons 8 (strcat "Dup_" e))(assoc 8 ent_e) ent_e))
Dup_LINES layer and so on..
Hope this helps