Prolific contributor Kent Cooper once again came to the rescue for someone in the Autodesk forums, and he is sharing the result here. This routine will allow you to interate the layer table in alphabetical order (or in reverse), setting each layer current along the way. Layers that cannot be set current (xref-dependent and frozen layers) will be skipped, but layers that are off can and will be set current. After you load the LISP file, use the command L> to set the Next layer current and the command L< to make the previous layer current. As usual, Kent's code is well documented and written. Note that this routine does not honor the Expert system variable that would normally cause a warning to be issued when the current layer is off. |