{"id":5401,"date":"2026-07-13T09:18:13","date_gmt":"2026-07-13T08:18:13","guid":{"rendered":"https:\/\/www.luso-cad.com\/?p=5401"},"modified":"2026-07-13T10:15:44","modified_gmt":"2026-07-13T09:15:44","slug":"xref-visretain","status":"publish","type":"post","link":"https:\/\/www.luso-cad.com\/en\/xref-visretain\/","title":{"rendered":"How to Prevent Loss of Layer Settings in Xrefs in LusoCAD"},"content":{"rendered":"<div data-elementor-type=\"wp-post\" data-elementor-id=\"5401\" class=\"elementor elementor-5401\" data-elementor-post-type=\"post\">\n\t\t\t\t<div class=\"elementor-element elementor-element-fd21dac e-flex e-con-boxed e-con e-parent\" data-id=\"fd21dac\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-136c388 elementor-widget elementor-widget-image\" data-id=\"136c388\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" width=\"900\" height=\"464\" src=\"https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1-1024x528.png\" class=\"attachment-large size-large wp-image-5406\" alt=\"\" decoding=\"async\" srcset=\"https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1-1024x528.png 1024w, https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1-300x155.png 300w, https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1-768x396.png 768w, https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1-18x9.png 18w, https:\/\/www.luso-cad.com\/wp-content\/uploads\/2026\/07\/1.png 1302w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8bda478 elementor-widget elementor-widget-text-editor\" data-id=\"8bda478\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Working with external references<a href=\"https:\/\/www.luso-cad.com\/en\/xref-lusocad\/\">Xrefs<\/a>is 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.<\/p><p>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.<\/p><hr \/><h2>What is the VISRETAIN Variable?<\/h2><p>The system variable:<\/p><p><span>VISRETAIN<\/span><\/p><p>controls how the host drawing treats layer properties from external references.<\/p><p>When<\/p><p><span>VISRETAIN = 1<\/span><\/p><p>The changes made to the Xref layers in the current drawing are maintained and saved with the file.<\/p><p>For example, if you change:<\/p><ul><li>Layer colour<\/li><li>Line type<\/li><li>Line thickness<\/li><li>Printing status<\/li><li>Visibility<\/li><\/ul><p>these changes remain available even after closing and reopening the drawing.<\/p><p>This is the recommended configuration for most users.<\/p><hr \/><h2>How to Verify VISRETAIN Value<\/h2><p>On the command line, type:<\/p><p><span>VISRETAIN<\/span><\/p><p>and press Enter.<\/p><p>LusoCAD will present the current value.<\/p><p>If necessary, introduce\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">1<\/span><\/p><p>to activate the retention of layer properties.<\/p><hr \/><h1>What is VISRETAINMODE?<\/h1><p>The variable<\/p><p><span>VISRETAINMODE<\/span><\/p><p>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.<\/p><p>While VISRETAIN decides whether local changes are kept, VISRETAINMODE determines which properties can be synchronised from the external reference.<\/p><hr \/><h2>Recommended Configuration<\/h2><p>For the traditional behaviour expected by most users:<\/p><div class=\"\"><span>VISRETAIN = 1<\/span><\/div><div class=\"\"><span>VISRETAINMODE = 0<\/span><\/div><p>With this configuration:<\/p><ul><li>The changes made to the current drawing take priority.<\/li><li>Layer properties are saved between sessions<\/li><li>Unexpected changes are avoided after reloading an Xref<\/li><\/ul><hr \/><h1>VISRETAINMODE Variable Values<\/h1><p>The variable uses numerical values to control the synchronised properties.<\/p><h3>Value 0<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">No properties are synchronised.<\/span><\/p><p>This behaviour is equivalent to the traditional operation of older AutoCAD versions when VISRETAIN was active.<\/p><hr \/><h3>Value 1<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Enable synchronisation of properties linked to the layer visibility state.<\/span><\/p><hr \/><h3>Valor 2<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Freeze<\/li><li>Thaw<\/li><\/ul><hr \/><h3>Valor 4<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Lock<\/li><li>Unlock<\/li><\/ul><hr \/><h3>Value 8<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Plot<\/li><li>No Plot<\/li><\/ul><hr \/><h3>Value 16<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Cor<\/li><\/ul><hr \/><h3>Value 32<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Line type<\/li><\/ul><hr \/><h3>Valor 64<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Line thickness<\/li><\/ul><hr \/><h3>128<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Transparency<\/li><\/ul><hr \/><h3>Value 256<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Plot style<\/li><\/ul><hr \/><h3>Value 512<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Freezing in Viewports<\/li><\/ul><hr \/><h3>Value 1024<\/h3><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">Synchronise<\/span><\/p><ul><li>Layer description<\/li><\/ul><hr \/><h2>Use Multiple Options Simultaneously<\/h2><p>It is possible to combine properties by summing their respective values.<\/p><p>For example:<\/p><p><span>3<\/span><\/p><p>corresponds to:<\/p><p><span>1 + 2<\/span><\/p><p>In other words:<\/p><ul><li>Visibility<\/li><li>Freeze\/Thaw<\/li><\/ul><p>will be synchronised automatically.<\/p><hr \/><h1>Why can layer settings disappear?<\/h1><p>There are several possible causes.<\/p><h2>VISRETAIN Disabled<\/h2><p>See\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">VISRETAIN = 0<\/span><\/p><p>The properties of the Xref can be redefined whenever the reference is updated.<\/p><hr \/><h2>2. VISRETAINMODE Inadequately Configured<\/h2><p>Certain combinations may cause specific properties to resynchronise from the Xref.<\/p><p>Always check the defined values if you observe any unexpected changes.<\/p><hr \/><h2>3. Geometry on Layer 0<\/h2><p>A frequently overlooked cause is the use of:<\/p><p><a href=\"https:\/\/www.luso-cad.com\/en\/layer-0-bylayer-byblock\/\"><span>Layer 0<\/span><\/a><\/p><p>within the external reference itself.<\/p><p>When many elements are drawn on layer 0, managing layer properties becomes less predictable.<\/p><p>Whenever possible, distribute objects across appropriate layers within the Xref.<\/p><hr \/><h2>4. Complex Xref Structures<\/h2><p>Problems can arise when there are:<\/p><ul><li>Xrefs aninhades<\/li><li>Circular references<\/li><li>Complex annexation chains<\/li><\/ul><p>In these cases, it may be useful to simplify the structure of the references.<\/p><hr \/><h1>Check XREFOVERRIDE Variable<\/h1><p>Another important variable is:\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">XREFOVERRIDE<\/span><\/p><p>Define:\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">XREFOVERRIDE = 1<\/span><\/p><p>and reload the external reference.<\/p><p>This configuration helps the host drawing retain local overrides defined for Xref layers.<\/p><hr \/><h1>How to Solve Xref Layer Problems<\/h1><p>If you continue to lose settings between sessions, follow this checklist:<\/p><h3>Step 1<\/h3><p>Check:\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">VISRETAIN = 1<\/span><\/p><hr \/><h3>Step 2<\/h3><p>Confirm:\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">VISRETAINMODE = 0<\/span><\/p><hr \/><h3>Step 3<\/h3><p>Define:\u00a0<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">XREFOVERRIDE = 1<\/span><\/p><p>and reload the reference.<\/p><hr \/><h3>Step 4<\/h3><p>Check if the xref geometry isn't all drawn in:<\/p><p><span>Layer 0<\/span><\/p><hr \/><h3>Step 5<\/h3><p>Analyse the existence of:<\/p><ul><li>Nested xrefs<\/li><li>Circular references<\/li><\/ul><hr \/><h3>Step 6<\/h3><p>Run drawing repair tools, such as:<\/p><p><span>AUDIT\u00a0<\/span><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">or\u00a0<\/span><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); text-align: var(--text-align); letter-spacing: 0px;\">RECOVER<\/span><\/p><p>to correct potential file integrity issues.<\/p><hr \/><h2>Tip for CAD Administrators<\/h2><p>If the variable values change repeatedly without user intervention, it's worth checking:<\/p><ul><li>Personalised profiles<\/li><li>Startup scripts<\/li><li>LISP routines<\/li><li>Third-party applications<\/li><\/ul><p>These customisations can automatically change system variables whenever a drawing is opened.<\/p><hr \/><h1>Conclusion<\/h1><p>When working with external references in <strong>LusoCAD<\/strong>, the variables <code>VISRETAIN<\/code> and <code>VISRETAINMODE<\/code> play a fundamental role in how layer properties are maintained between sessions. In most work environments, the combination <code>VISRETAIN = 1<\/code> and <code>VISRETAINMODE = 0<\/code> offers the most predictable behaviour and avoids the loss of local changes.<\/p><p>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.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>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.<\/p>","protected":false},"author":4,"featured_media":5414,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5401","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/posts\/5401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/comments?post=5401"}],"version-history":[{"count":13,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/posts\/5401\/revisions"}],"predecessor-version":[{"id":5417,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/posts\/5401\/revisions\/5417"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/media\/5414"}],"wp:attachment":[{"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/media?parent=5401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/categories?post=5401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.luso-cad.com\/en\/wp-json\/wp\/v2\/tags?post=5401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}