Following on my last post about restoring layer states, I thought I should spend a little more time explaining how layer state restoring works in paper space. People are often confused about the logic behind how layer states are restored in model space and in paper space and it is a question that I get a lot. First, let me start with some foundational concepts.
The on/off and freeze/thaw settings for a layer really only apply in model space. Layers in a viewport are just visible or not visible - you see them or you don't. Whether a given layer is visible in a viewport is ultimately controlled by a combination of its VP freeze setting in that viewport and the global visibility settings (on/off and freeze/thaw) in model space. This is an important concept to understand.
When you’re in paper space, the On/Off and Freeze/Thaw restore options in the Layer States Manager are disabled because they only affect model space visibility and we are not manipulating those settings unless necessary to give the expected results in a viewport. This is why one of the layer state property restore options is simply labelled Visibility in Current VP and that option is only enabled when you are in a viewport. Whether a layer state restores the visibility of the layer in a viewport is controlled by the Visibility in Current VP option.
So, restoring a layer state to a viewport works like this:
- If a layer is already on and thawed in model space and should be visible in the viewport, we VPTHAW it in the viewport and make no change to model space visibility.
- If a layer should not be visible in the viewport, we simply VPFREEZE it in that viewport and make no changes to model space visibility.
- If a layer is off and/or frozen in model space and should be visible in the viewport, we VPTHAW it in the viewport and then make whatever model space changes are necessary (on and/or thaw) so it will be visible in the viewport.
There is a distinction between restoring in paper space and restoring in model space and they are treated like the two different environments they are. This distinction was necessary to fix a legacy problem with restoring layer states in paper space.
In earlier versions of the Layer State Manager, prior to AutoCAD 2008, if you had a layout with multiple viewports and you needed to restore a different layer state in each viewport, you ran a very high risk that every subsequent layer state restore, after the first one, would affect the look of the viewports restored before it. This happened because the model space on/off and freeze/thaw settings were automatically being restored while in paper space viewports. Since those settings are global visibility changes, you would have layers that were previously visible in viewport 1 being globally turned off by the restore to viewport 3. Very frustrating! Since the release of AutoCAD 2008, when restoring a layer state in a viewport, the Layer State Manager does not manipulate the model space on/off and freeze/thaw layer settings unless it is necessary to make a layer visible in the viewport. This avoids the problem encountered when restoring multiple layer states to multiple viewports.
The key to getting expected visibility results when restoring layer states is to treat model space and paper space like separate environments. It makes sense if you think about it. Changing the visibility of a layer in model space can affect whether or not that layer displays in a paper space viewport because you're changing a global visibility setting. Until the day comes when layer visibility can be controlled independently between model space and paper space (as we now have with some layer properties) this will always be the case.