@sam wrote:
....
Would it be possible to do it with code to keep only certain set of layers on and all others off.
For example: If i have layers naming (1,2,3,4...25) and if I call ALayers only layers 1-5 are on and all the rest are off from 6-25. So on if I call Blayers only Layers from 6-10 are on and 1-5, 11-25 are off.
....
You can apply most Layer-command options [including On and Off] to multiple Layers at once, using comma separators between Layer names. So if you save the sets of Layer names as comma-delimited strings, rather than lists, it's pretty simple:
(setq
Alist "ThisLayer,ThatLayer,OtherLayer,SomeLayer"
Blist "WhoLayer,WhatLayer,WhenLayer,WhereLayer"
Clist "0Layer,1Layer,2Layer,3Layer"
); setq
(defun LayerStuff (Llist / expt); sub-routine called by commands
(setq expt (getvar 'expert)
(setvar 'expert 1); suppress "turn-off-current-Layer?" question
(command "_.layer" "_off" "*" "_on" Llist ""); all off, then some on
(setvar 'expert expt)
); defun
(defun C:Alayers () (LayerStuff Alist))
(defun C:Blayers () (LayerStuff Blist))
(defun C:Clayers () (LayerStuff Clist))
Consider whether you want one of those that is going to be On in the end to become the current Layer, or whether something like Layer 0 could be made current in the process.
Kent Cooper, AIA