Here's a peculiarity for you, that can greatly simplify such an operation:
If you use entity data's 8-code Layer-name entry to assign a Layer to an entity, if the Layer doesn't already exist, it creates it in the process! So you can build a new Layer name and give it to an entity with (subst)/(entmod) operations on its entity data list, without making the Layer first or checking whether it exists! [This is not true when doing it with (vla-put-Layer) or the CHPROP command, which will fail if the Layer doesn't exist.]
After doing that to a selection set's worth of things, putting them on Layers whose names add -DEMO to the name of their original Layer, you can then simply assign the color and linetype to all Layers whose names end in -DEMO, all at once, whether they already existed yet or are newly-created ones [the latter will initially have had default color 7 and CONTINUOUS linetype].
Try this [just for the -DEMO Layer-name transfer, not including the wall-style aspect]:
(defun C:DEMOLT ; = DEMOlition Layer Transfer
(/ ss n edata lay)
(if (setq ss (ssget "_:L")); anything not on locked Layer(s)
(progn ; then
(repeat (setq n (sslength ss))
(setq edata (entget (ssname ss (setq n (1- n)))))
(if (not (wcmatch (strcase (setq lay (cdr (assoc 8 edata)))) "*-DEMO"))
; not already on a Layer ending in it [in any case combination]
(entmod (subst (cons 8 (strcat lay "-DEMO")) (assoc 8 edata) edata))
; replace its Layer name with -DEMO added, whether or not that Layer exists
); if
); repeat
(command "_.layer" "_color" 1 "*-DEMO" "_ltype" "HIDDEN2" "*-DEMO" "")
; assign those properties to all Layers whose names end in -DEMO
); progn
); if
(princ)
); defun
You can even include things already on -DEMO Layers in the selection, and it won't add a redundant -DEMO to their names [though if any of their Layers don't already have that color and linetype, it will "fix" that about them].
That's in simplest terms -- you can add *error* handling, command-echo suppression, Undo begin-end wrapping, etc.
Kent Cooper, AIA