Modify this line:
(setq plList (cdrs 10 plEnt))
to:
(setq plList (ALE_List_RemoveDupOnLst (cdrs 10 plEnt)))
; Function: ALE_List_RemoveDupes
;
; Version 1.00 - 9 Apr 2003
;
; Description:
; removes all the duplicated elements leaving originals,
; faster on lists with low number of duplicates
; For example:
; (setq alist (atoms-family 1))
; (setq alist (append alist alist alist alist))
;
; Arguments:
; In_Lst = A list
;
(defun ALE_List_RemoveDupOnLst (In_Lst / OutLst)
(reverse
(foreach ForElm In_Lst
(if (vl-position ForElm OutLst)
OutLst
(setq OutLst (cons ForElm OutLst))
)
)
)
)