Does anybody here know how to delete a layer using lisp? The layer has nothing on it, and can be deleted, I would rather not use the purge command as it write a bunch of junk to the command line when purging a layer.
;; type the layer name you want to delete
(setq layer_name "a-dim")
(if (not (vl-catch-all-error-p
(setq vla_layer (vl-catch-all-apply
'vla-item
(list (vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)))
layer_name)))))
;; if is possible it will be deleted...
(vl-catch-all-apply 'vla-delete (list vla_layer)))