Does anyone know of a way to assign a layer's on/off switch to associate with a particular layout? My drawings usually have 15-20 layouts, and they're cluttered with cabinets, toekicks, plumbing, electrical, countertops, lighting, etc. Here's what I've been doing when I need to print out a set of drawings: click 1st layout, load the appropriate layer state, plot. Click 2nd layout, load appropriate layer state, plot, etc. I was hoping the sheet set manager would have some control over layers, but it doesn't seem so. I have a feeling there's a way to automate this, but I'll be darned if I can find it. Any hints?
From contributor A:
I believe that there is a "viewport freeze" feature in the layer control box which does this type of thing. The icon looks like a sun with a rectangle. In ACAD 2008 it is the last column to the right in the dialog box. I think it's in 2004 also. The trick is that it is only available while in the layout, not in model space.
That will open the Named View manager. You can also access it from the ribbon on the viewport panel, the first button to the right of the drop down.
To make a Named View, set the layers on or off according to how you want them to show. I prefer on/off to freezing, it saves trouble later. Once your layers are correct, zoom to the view you wish to see. Enter the View command, use the New button on the right. Give the view a name. You can define the boundry, or use the one you have already zoomed to. Under Settings, leave the save layer snapshot with view. The UCS should be current, or if you want to change it, go ahead, but usually it's correct already. Click okay. Click Apply, and Ok again, though Ok usually works fine. You have created a Named View.
Why do this? If you have multible views, you can jump back to them through that drop down command window on the viewport panel. This is very useful when you are jumping back and forth between places and layers. Also, when you make a Viewport in paper space, click into model space and jump to the named view. Scale your viewport and close the window. Your layers and view should remain the same.
Now for the hiccup. Depending on what you are working with (computer, OS, video card, etc.) you may find that your image becomes disconnected with what AutoCAD thinks is the image's location. The easy fix is the Regen command. You may have to jump to another view and jump back to the one you just made, Regen again. That usually solves the problem, and you usually only have it when you create the view. That's 2009 for you.
Named Views are awesome if you create large drawings, multible layers, and lots of viewports.
;freeze and unfreeze
(defun c:freeze (/ el l lt)
(setvar "CMDECHO" 0)
(setvar "tilemode" 0)
(setq lt (vla-get-layers (vla-get-activedocument (vlax-get-Acad-Object)))
l (tblnext "layer" T))
(while l (setq el (vla-item lt (cdr (assoc 2 l))))
(if (= (vla-get-layeron el) :vlax-false)
(vl-cmdf "_VPLAYER" "f" (vla-get-name el) "" ""))
(setq l (tblnext "layer")))