I use a bunch of xlines and I would like to be able to use a lisp routine to delete only xlines in a drawing. I have tried various selection set choices but cannot get xlines included. layer nuke would be a careful alternative but would like to avoid
that.
The following code works but i know there has to be a better way. any help appreciated.
(defun c:clerase()(terpri)
(command "-LAYER" "LOck" "*" "")
(command "-LAYER" "Unlock" "Sketch" "") ;all created xlines go on this layer
(command "zoom" "extents" "")
(command "zoom" "Scale" "0.5X" "") ;so the user can see if anything other than x-lines will be deleted
(alert "This will ERASE EVERYTHING on layer Sketch! \n non-faded items other than xlines will be gone!")
(setvar "cmdecho" 0)
(command "ERASE" "ALL" "" )
(command "-LAYER" "Unlock" "*" "")
(command "-LAYER" "Set" "M-Field-Devices" "") ;The layer I usually work on
(setvar "cmdecho" 1)
(command "zoom" "Previous" "")
(command "zoom" "Previous" "")
(alert "You Can Press Undo repeatedly \n to get back, if any, lost data.")
(princ)
)