You can certainly do it with a script but I prefer the Tool Palette.
Enter CUI on command line then click-and-drag a command from the Command List to a blank area of your tool palette. To keep organized, you can create your own 'Tool Palette Group' (I named my group MyCustom) and you can have multiple TABS in your TP Group (I have a separate Tabs named LAYERS, CREATE, ANNO).
Since there's no specific command to turn OFF an existing named layer, you can drag an arbitrary command from the CUI and drop it directly onto a blank area of your Tool Palette (I choose the command 'Layer,Layer Off' from the CUI (use the Search function in the CUI) and dropped it directly onto my Layers Tab because I liked this command's icon--your choice of icon may vary). Next, I copied the new command and pasted a duplicate on the same tab directly below the first one.
Once the two commands were placed on the TP 'Layers' Tab, you can right-click the new icon, choose Properties and make edits to the Name, Description etc, etc. The most important edit though, is replacing the existing macro with your customized macro so you can achieve your specific task. Here's a view of the two commands on the Tool Palette and the customization that make them work.
^C^C^C-LAYER;ON;BLDG;;
^C^C^C-LAYER;OFF;BLDG;;

Notes:
- To see how the command works, enter -LAYER (you must enter the 'dash' before the L) on command line and follow the prompts.
- You need separate commands to turn a specific layer on and off.
- If you need the same on/off action on another layer, e.g. ROAD layer, copy-and-paste the command then edit the command's name, description and macro in properties so it reflects the ROAD layer instead of BLDG layer.
- From the CUI you may drag-and-drop the polyline command and keep all Default values in Properties except for LAYER: change it from --use current to BLDG. When you execute this new polyline command you'll be drawing on the BLDG layer no matter what the current layer happens to be. (Make sure the BLDG layer is thawed or the pline won't be visible until BLDG is thawed.)
- The Tool Palette will 'travel' from drawing-to-drawing so if you work on mulitple at the same time the commands will be available as long as you don't close the palette. If you do close it simply reopen it, the commands don't go away.
Chicagolooper
