I am hoping someone can tell me how to do this without the lisp asking for the objects multiple times.
This lisp does a couple of things in this order.
1. Selects all SOLID entities in the drawing and erases all the selected entities
2. Changes the color property of all entities left behind (after step 2) to BYLAYER, using the AutoCAD command "CHPROP".
3. Moves all entities left behind (after step 3) to a layer named "g-heavy", using the function "c:g-heavy".
4. Performs an "overkill" operation on all entities
;; DESCRIPTION
;;;
;;; Clean up exl2dwg
;;; Kills the solids, moves everything to the g-heavy layer
;;; Does an overkill
;;;
;;;Lonnie Shaw
;;; 2023/05/12
;;; ---------------------------- Main program --------------------------------;
(defun c:exl ()
(setq ss (ssget "_X" '((0 . "SOLID"))))
(if ss
(progn
(command ".erase" ss "")
(if (/= (sslength ss) 0)
(progn
(command "CHPROP"
ss
""
"_C"
"BYLAYER"
""
)
(c:g-heavy)
(command "-overkill" ss "" "")
; (princ (strcat "\n" (itoa (sslength ss)) " entities remaining."))
)
)
)
(princ "\nNothing selected.")
)
)
Thanks in advance.
Lonnie