• Blog posts


    By Dennis Collin


    Sometimes when working with drawings with External References, the layer states setting can be lost in between editing sessions. This problem occurs with AutoCAD if the VISRETAIN variable is set to zero or is reset, possibly from a third-party app. The problem can also occur if elements are placed on layer 0 within the Xref file.


    The VISRETAIN variable is set within the drawing file with a default value of 1 (ON). This variable Controls the visibility, colour, linetype, line weight and plot styles. This system variable is used along with the VISRETAINMODE system variable to manage which Xref layer property overrides you want to automatically synchronise on reload. When VISRETAIN is switched on the Xref-dependent layer changes made in the current drawing take precedence. Layer settings are saved with the current drawing's layer table and persist between AutoCAD sessions. For this to work VISRETAINMODE needs to be set to Zero (OFF). This will provide the same user experience with legacy AutoCAD releases with the VISRETAIN variable enabled.

    The following steps should solve the loss of Xref Layer States or indicate the cause:

    • Within the host drawing, ensure VISRETAIN is set to 1.
    • Ensure that AutoCAD’s variable VISRETAINMODE is set to 0.
    • Verify that drawing geometry in the Xref(s) is not placed on layer 0.
    • On the command line in AutoCAD, type XREFOVERRIDE and set it to 1. Reload the Xref.
    • If a nested Xref is involved, try un-nesting it and referencing it directly. Correct any circular Xref attachments.
    • Use the System Variable Utility to see which variables are deviating from default values.
    • If any customisation exists that may be resetting system variables like lisp routines or custom profiles, reset AutoCAD.
    • Repair the host drawing and Xrefs (Use Recover, Recover with Xrefs or Audit commands).