How to Prevent Loss of Layer Settings in Xrefs in LusoCAD

Do your Xref layer settings keep disappearing every time you reopen a drawing? In this article, we explain how the VISRETAIN, VISRETAINMODE, and XREFOVERRIDE variables help keep external reference properties consistent between sessions in LusoCAD.

Working with external referencesXrefsis a common practice in CAD projects of any size. However, some users may notice that certain layer settings, such as colours, linetypes, or visibility states, appear to disappear when they reopen the drawing or reload an external reference.

In most cases, this behaviour is related to system variables that control how LusoCAD manages the properties of layers originating from Xrefs. Understanding these settings helps to avoid loss of configurations and ensures a more consistent working experience.


What is the VISRETAIN Variable?

The system variable:

VISRETAIN

controls how the host drawing treats layer properties from external references.

When

VISRETAIN = 1

The changes made to the Xref layers in the current drawing are maintained and saved with the file.

For example, if you change:

  • Layer colour
  • Line type
  • Line thickness
  • Printing status
  • Visibility

these changes remain available even after closing and reopening the drawing.

This is the recommended configuration for most users.


How to Verify VISRETAIN Value

On the command line, type:

VISRETAIN

and press Enter.

LusoCAD will present the current value.

If necessary, introduce 1

to activate the retention of layer properties.


What is VISRETAINMODE?

The variable

VISRETAINMODE

It works in conjunction with VISRETAIN and allows you to control exactly which properties of Xref layers should be synchronised when the reference is updated.

While VISRETAIN decides whether local changes are kept, VISRETAINMODE determines which properties can be synchronised from the external reference.


Recommended Configuration

For the traditional behaviour expected by most users:

VISRETAIN = 1
VISRETAINMODE = 0

With this configuration:

  • The changes made to the current drawing take priority.
  • Layer properties are saved between sessions
  • Unexpected changes are avoided after reloading an Xref

VISRETAINMODE Variable Values

The variable uses numerical values to control the synchronised properties.

Value 0

No properties are synchronised.

This behaviour is equivalent to the traditional operation of older AutoCAD versions when VISRETAIN was active.


Value 1

Enable synchronisation of properties linked to the layer visibility state.


Valor 2

Synchronise

  • Freeze
  • Thaw

Valor 4

Synchronise

  • Lock
  • Unlock

Value 8

Synchronise

  • Plot
  • No Plot

Value 16

Synchronise

  • Cor

Value 32

Synchronise

  • Line type

Valor 64

Synchronise

  • Line thickness

128

Synchronise

  • Transparency

Value 256

Synchronise

  • Plot style

Value 512

Synchronise

  • Freezing in Viewports

Value 1024

Synchronise

  • Layer description

Use Multiple Options Simultaneously

It is possible to combine properties by summing their respective values.

For example:

3

corresponds to:

1 + 2

In other words:

  • Visibility
  • Freeze/Thaw

will be synchronised automatically.


Why can layer settings disappear?

There are several possible causes.

VISRETAIN Disabled

See VISRETAIN = 0

The properties of the Xref can be redefined whenever the reference is updated.


2. VISRETAINMODE Inadequately Configured

Certain combinations may cause specific properties to resynchronise from the Xref.

Always check the defined values if you observe any unexpected changes.


3. Geometry on Layer 0

A frequently overlooked cause is the use of:

Layer 0

within the external reference itself.

When many elements are drawn on layer 0, managing layer properties becomes less predictable.

Whenever possible, distribute objects across appropriate layers within the Xref.


4. Complex Xref Structures

Problems can arise when there are:

  • Xrefs aninhades
  • Circular references
  • Complex annexation chains

In these cases, it may be useful to simplify the structure of the references.


Check XREFOVERRIDE Variable

Another important variable is: XREFOVERRIDE

Define: XREFOVERRIDE = 1

and reload the external reference.

This configuration helps the host drawing retain local overrides defined for Xref layers.


How to Solve Xref Layer Problems

If you continue to lose settings between sessions, follow this checklist:

Step 1

Check: VISRETAIN = 1


Step 2

Confirm: VISRETAINMODE = 0


Step 3

Define: XREFOVERRIDE = 1

and reload the reference.


Step 4

Check if the xref geometry isn't all drawn in:

Layer 0


Step 5

Analyse the existence of:

  • Nested xrefs
  • Circular references

Step 6

Run drawing repair tools, such as:

AUDIT or RECOVER

to correct potential file integrity issues.


Tip for CAD Administrators

If the variable values change repeatedly without user intervention, it's worth checking:

  • Personalised profiles
  • Startup scripts
  • LISP routines
  • Third-party applications

These customisations can automatically change system variables whenever a drawing is opened.


Conclusion

When working with external references in LusoCAD, the variables VISRETAIN and VISRETAINMODE play a fundamental role in how layer properties are maintained between sessions. In most work environments, the combination VISRETAIN = 1 and VISRETAINMODE = 0 offers the most predictable behaviour and avoids the loss of local changes.

With some simple checks and good management of layers in Xrefs, it is possible to ensure greater consistency in projects and eliminate one of the most common problems associated with collaborative work with external references.

en_GBEnglish

LusoCAD TRIAL Version

Spanish version:

English version:

LusoCAD More Info

LusoCAD TRIAL Version

LusoCAD

Below you will find a comparative table of the main functionalities available in LusoCAD 2027 and AutoCAD® 2027.

LusoCAD vs AutoCAD®

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
64-bit Support
.dwg for AutoCAD version R14 to latest
.pat,.shx,.lin and etc
Password Protection
File Recover and Audit
Purge
Etransmit
Sheet Set Manager
CAD Standard .dwsX
DWF Underlay
PDF Underlay
DGN Import and Underlay
DWG Convert
Import to WMF, SAT, 3DSPartiallyPartially
Export to DWG, DWF, DWFX, WMF, SAT, STL, EPS, DXX, BMP, EMFPartiallyPartially
Plot and Publish to PDF
Publish to DWF 2D & 3D
IFC Import/Export and EditXXX
RVT Import and EditXXX
Single-document Mode
Digital Signature
Batch Digital Signing Tool
Reset Settings to Default.
Mark UpXXX
STEP/IGES FilesXX
DWGUNITS
Drawing MergeXX
Connected Support FilesXXXX
Activity InsightsXXXX
Connected ReferencesXXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
3D Modelling Workspace
Quick Properties
Block Palette XXX
Dark Theme
Hidden Message Settings
WorkSpace command
CUI Menus and Toolbars X
CUI Import & Export
Drag and Drop Customisation XX
Visual Menu Customisation
Ribbon/Classic
Properties Palettes
Design Centre/Tool Palette/Xref Palette
Command Line
Clean Screen
Dynamic Input and Auto Complete
Clickable Command Line Options XXX
File Tab
Floating Windows XXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Navigation CubeX
3D Mouse Device Adaption
Lasso Selection
SELECTIONCYCLING
Right-Click + Drag Method
Selection Preview
Selection Effect Customisation XXX
Quick Select
Select Similar
Multifunctional Grips
OSnap
Grid and Snap
Polar & OTrack
Group
Distance from Endpoint and Divide Segments XX
ADDSELECTED Command
Multiple command

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Quick Measure by Hovering Rapid Distance Rapid Distance Rapid Distance
DIMCENTER Command PartiallyPartially
Reassociate Dimension
DIMTOFFSET XX
Standard Dimensions
Associative Dimension
Dimension Break
Quick Dimension
Qleader
Dynamic Dimensions
Multileaders
Voice Annotation XX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Auto ConstraintXXXX
Coincident ConstraintXX
Perpendicular ConstraintXX
Parallel ConstraintXX
Tangent ConstraintXX
Horizontal ConstraintXX
Vertical ConstraintXX
Collinear ConstraintXX
Concentric ConstraintXX
Smooth ConstraintXXX
Symmetric ConstraintXX
Equal ConstraintXX
Fix ConstraintXX
Constraint SettingsXX
Delete ConstraintsXX
Show/Hide ConstraintXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Linear ConstraintXXX
Horizontal ConstraintXXX
Vertical ConstraintXXX
Aligned ConstraintXXX
Angular ConstraintXXX
Radius ConstraintXXX
Diameter ConstraintXXX
Constraint SettingsXXX
Delete ConstraintsXXX
Show/Hide ConstraintXXX
Parameters ManagerXXX
Dynamic Constraint ModeXXX
Annotational Constraint ModeXXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Mtext
Text
Multi-language Character Set
In-place Text Editor
Mtext Superscript and Subscripts
Support .shx and .ttf font
Spelling
Fields
Text Align / Text Match Text AlignText Align
Change Text X X
Mtext Editor
Text Incremental Copy X X
Text on lineX X
Statistics SummationX X
Check spelling in Mtext
Revcloud
Wipeout X X
Automatic Text Numbering

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Auto Layer XX
Change to ByLayer (SETBYLAYER)
Layer Properties Manager
Layer States Manager
Layer Translator X
Layer Walk
Layer Previous
Layer Isolate
Layer Unisolate
Layer Lock
Layer Unlock
Layer Unlock All XX
Lock Other Layers XX
Layer Freeze
Freeze Other Layer XX
Thaw All Layers
Layer Off
Off Other Layer XX
Turn All Layers On
Layer Merge
Layer Delete
Layer Match
Viewport Layer

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Hatch objects from Tool Palettes
Gradient Hatches
Custom Patterns
Background and Colour for Hatch Patterns
Trim/Extend of/to Hatch Pattern Entities
Superhatch X
Transparency for Hatch
Trim/Extend/Hatch preview

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Raster Image Support (Clipping, Transparency, ...)
Support Kinds of Image Files (bmp, jpg, png, tga, tif, gif, pcx, ...)

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Lockup Command X X
Layout Merge
Synchronise Viewports
Breakpoint Check (CLOSELINE)XX
Fast Select (FASTSEL)
Change Base XX
Layer Draw Order XX
Stat, Blocks Number Count CommandCount Command
Area TableXX
Break Object XX
Block Break XX
Graphic Compare XX
Batch Purge XX
Layout by Path Array pathArray path
Line2pl XX
SptplXX
LusoCAD Tools XX
Plot tools XX
Drawing Compare DWG CompareDWG Compare
Delete Duplicate Objects (OVERKILL)
Drawing Lock XX
Block Replace

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Hardware Acceleration X X
Break at Point
Region X
Areasum XX
Draw and Modify Commands
Outline Objects XX
Align Tool / Arrange Tool XX
Real Time Pan & Zoom
SteeringWheels XXX
Magnifier XXX
Redraw and Regeneration
Layout and Paper Space
Non-rectangular viewports
Layout Viewport settings
Multilines and Multiline Styles X
Block create and insert
Redefine Block
Refedit
Dynamic Block - Create/Insert/View Partially
Block Attribute Definition
Barcode & QRcode XX
Dynamic Block Editor (BEDIT) Partially
Table ToolsXX
Table
AutoXLSTableXX
Make Shape
Import Layout as Sheet
Viewport Scale
Attribute Increment XX
Define Layout Viewport from ModelSpace (M2LVPORT) XX
Security X
Free Scale XX
Hatch to Back
Reverse
Synchronise Attributes
Clip
Array Options
Symmetric Draw XX
Smart centrelines/center marks XXX
Invert Fillet XX
Offset Multiple
Helix
Cloud Storage
Design share XX
Shortcut Customisation (CUSTACC) XX
Match Properties Across Drawings
Hyperlink
Digitizer Integration
Scale List
Pline Boolean XX
Xref path repair XXX
Undo/Redo Preview
VPMAX/VPMIN
Table
Barcode & QR Code XX
Non-rectangular viewports
Block Attribute Definition
Dynamic Block Create/ Insert/View/Edit Partially
Smart Blocks XXXX
Geometry TinkeringXXX
AI AssistantXXX
Forma Data Management EssentialsXXXX
CheckoutXXXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
POLYSOLID XX
PLANESURF XX
SURFOFFSET XX
CONVTOMESH XX
CONVTOSOLID XX
CONVTOSURFACE XX
CONVTONURBS XX
Point Cloud X
3D Edition Grips XX
Section Plane XX
Flatshot XX
Solid editing XX
3D Surfaces X
ACIS Modelling & Editing XX
Camera XXXX
3D Orbit options X
Render XX
Visual Styles ManagerXX
Solprof / Solview / Soldraw XX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
CTB & STB Plot Style Files
Built-in Print Driver
Import & Editing of Page Setups
Publish
Hide and Shade Plot
Batch Print XX
Arrange Frame XX
Plot Styles Table Editor
3D Print Studio XXXX
AUTOPUBLISH

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Load Python
LISP Debugger X
LISP vl-, vlr-, vla- and vlax X
LISP Encryption
(SDS/ADS) X
DCL / DCL engine / COM API X
Visual Basic for Applications X
VBA VBI projects support XDVB
.Net Framework X
GRX (LusoCAD Runtime eXtension) XARX
CUI Menu Support/Diesel Expressions
Diesel Expressions
MNU and MNS File Support
API (Toolbar & Menu Customisation) X
Entity Data EditorX
Action Recording and Action MacrosXXXX

LusoCAD 2027

AutoCAD®2027

StdProPremiumLTFull
Subscription
Perpetual Licence XX
Stand-alone USB dongle XX
Network USB dongle XX
Stand-alone Licence
Network Licence XX