overkill in lisp routine

I found an example of the overkill command used in a routine:
(defun c:Test (/ ss)
(if (setq ss (ssget ))
(progn (sssetfirst nil ss)
(vla-sendcommand
(cond (aDoc)
((setq aDoc
(vla-get-activedocument
(vlax-get-acad-object))))
)
"-OVERKILL IGNORE LWeight,Layer "
)
)
)
(princ)
)

But if I want to continue, I can't use the old selectionset ss. Is it possible to continue with a new selection set without the removed elements?

Comments

  • why did you cant use the old one?
    I think you can check each item in this ssset if exists and if so, leafe it in the ssset, otherwhile remove the item of the ssset

  • Thanks for your reply Martin, that sounds logic.
    But I am more of a copy/paste/edit person when it comes to lisp... Not so great in writing new code :blush:
    So please, can you show me how to do that? Or which functions to use?

  • (defun c:Test (/ ss item)
    (if (setq ss (ssget))
    (progn
    (command "-overkill" ss "" "Ignore" "lweight" "Ignore" "Layer" "")
    (foreach item (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
    (if (not (entget item))
    (setq ss (ssdel item ss))
    )
    )
    )
    )
    (princ)
    )

This discussion has been closed.