Thanks Juerg, it works like a charm. Sometimes, more often than not for me it seems, that when we read something, we stop at some word, " cond " in this case and don't bother to read further. If I were to do it myself with " cond " I would have ended up with one " cond " statement for each layer name as I wasn't aware of the " wcmatch " function. I used to read the manual for each version of AutoCad at least once but with electronic manuals and help files I haven't been able to do any reading. I must be getting old.