@FCort wrote:
....
Please indicate how to use this code. ....
I copied the code to note pad, and saved as name.LSP, then type command appload, the select the lisp file, but it doesn’t work.
....
Did you pick the Load button after selecting the file? And did you type the DFL command name? If so, what does "doesn't work" mean? Loading fails somehow? Loads but command name isn't recognized? Command name goes in but nothing happens? Command name goes in but it does something differently from what you expect? Error message(s) of any kind? Etc.
As to the Layer selection, there are some things that might be a starting point on another thread. This Post of mine has LayerThawOnSelect.lsp, which temporarily thaws, and turns on, and highlights the contents of, all Layers that are Frozen or Off, so you can select an object on any such Layer you want, and the Layer name will go into a list. What it does with the list can be changed to getting rid of everything on those Layers, instead of Thawing and turning them On. There are other Posts on that same thread that generate dialog box lists you can pick from, if you prefer that approach, and again could be modified easily enough for what you want to do.
On a side note, I notice something that could be consolidated in my routine above. This part:
...
(if
(and
(= (logand 1 lay70) 1); it's frozen
(= (logand 4 lay70) 0); it's not locked
); and
(setq laynames ....
could be just this:
....
(if (= (logand 5 lay70) 1); it's frozen and not locked
(setq laynames ....
Kent Cooper, AIA