Layerstates with xref layers don't apply permanent xref overrides

Layerstates with xref layers don't apply permanent xref overrides

EliANewlines
Advocate Advocate
1,889 Views
22 Replies
Message 1 of 23

Layerstates with xref layers don't apply permanent xref overrides

EliANewlines
Advocate
Advocate

When I apply a layerstate, it permanently changes all non-xref layers. However, the xref layers seem to be in limbo: the properties are different, but in layer properties manager there are no xref overrides shown. The reason this matters is that when I reload the xref, all the properties revert to the original xref properties.

 

For example, in the original xref drawing, A-BLDG is set to cyan:

 

EliANewlines_0-1723657501715.png

 

In the host drawing, I apply a layerstate which changes the xref layer A-BLDG to yellow and I get this:

 

EliANewlines_1-1723657572238.png

 

However, there is no "xref overrides" layer filter, as you can see.

 

The only way to get an xref override is to manually select the layer and change the color to yellow, which results in this:

 

EliANewlines_2-1723657747357.png

 

As you can see, once I do that, I get an actual xref override. As mentioned, I need the override, otherwise the xref layer reverts to the original color when I reload.

 

My layer settings are as follows:

VISRETAIN = 1

VISRETAINMODE = 2047

XREFOVERRIDE = 0

 

I understand that an easy fix would be to change VISRETAINMODE to 0, because then it won't even look at the original xref layer color. However, I want to keep VISRETAINMODE at 2047, because in general I want to sync xref properties which don't have overrides.

 

Any ideas?

0 Likes
Accepted solutions (1)
1,890 Views
22 Replies
Replies (22)
Message 2 of 23

cadffm
Consultant
Consultant

Hi,

 

on my side, it works different (restore layerstate and I get an xref layer override), in ACAD

 

What Product you are using {you posted in AutoCAD board, but you are using another software variant, I guess CIVIL3D?}

and what productversion? Command: ABOUT

 

 

Sebastian

0 Likes
Message 3 of 23

pendean
Community Legend
Community Legend

Did you create your LAYERSTATE with or without the XREF present?

Why is there a DOOR filter in one screenshot but not the others?
What significance is that since not all three match?

if you make changes to the source file (aka the 'xref'), you first have to turn off VISRETAIN in the top file, reload the XREF, then turn it back on for those layer settings to be updated in the top file. I don't quite understand how what you want is possible without it except to not change the source XREF in the first place, but do it only in the top file with the "door" filter (by recreating your layerstate to capture the XREF-named layers).

Why not use XREFOVERRIDE command (well, system variable, but you know what I mean)?

Can you also show us the LAYERSTATE command pop-up so we can see what options to selected/deselected before running your custom "layerstate" please.

0 Likes
Message 4 of 23

cadffm
Consultant
Consultant

>>"Why is there a DOOR filter in one screenshot but not the others?"

Because the first shot is from the file what is xrefs as "doors" insode another file (where both others shots came from)

 

>>"if you make changes to the source file (aka the 'xref'), you first have to turn off VISRETAIN in the top file, "

No, Visretainmode do the job too (but for not overriden xref layers only)

 

 

>>" XREFOVERRIDE "

? Xrefoverride changes object properties temporary, not layerproperties

 

 

Sebastian

0 Likes
Message 5 of 23

EliANewlines
Advocate
Advocate

Yes, I am using Civil 3D. I thought that because this question wasn't about civil 3d specific features, i should just post in this forum.

 

EliANewlines_0-1723659987492.png

 

0 Likes
Message 6 of 23

cadffm
Consultant
Consultant

Hi,

 

I think I found the puzzle piece you didn't mention: You are using a XREF-Layerstate in your host file, right?

The Layerstate is part of the Xref-file,

it isn't a layerstate as part of the host file.

 

!?

If I use Xref-Layer states, I can reproduce it (the "wrong status" is just temporary)

if I use Layerstates from the hostfile, it works as expected.

 

 

 
 

 

 

Sebastian

0 Likes
Message 7 of 23

EliANewlines
Advocate
Advocate

I really appreciate your effort on this, thanks!

 

I also thought it might be due to the type of layerstate, but it isn't. I tried with all three types of layerstates - model, layout, and xref - and all three didn't produce a permanent override.

0 Likes
Message 8 of 23

EliANewlines
Advocate
Advocate

Additionally, it isn't due to any other checkboxes in the layerstate manager. This is what my manager looks like:

 

EliANewlines_0-1723661313974.png

 

 

0 Likes
Message 9 of 23

cadffm
Consultant
Consultant

Hi,

 

 

 

>>"I also thought it might be due to the type of layerstate, but it isn't."

>>"I tried with all three types of layerstates"

>>"- model, layout, and xref"

>>"- and all three didn't produce a permanent override."

 

Model and Layout should work (in mode tab, or by disable 'as vp override' option),

try it again! Restart and let's test.

 

 

Sebastian

0 Likes
Message 10 of 23

cadffm
Consultant
Consultant

@EliANewlines wrote:

Additionally, it isn't due to any other checkboxes in the layerstate manager.

This is what my manager looks like:

You are right, but

 

And you posted a screenshot with 95% options hidden 😆


cadffm_0-1723661722913.png

 

 

[F1] Layerstates

 

Sebastian

0 Likes
Message 11 of 23

EliANewlines
Advocate
Advocate

Model and layout "should" work, but they don't. Nothing changes if I uncheck "apply as viewport overrides".

See attached recording.

 

 

 

0 Likes
Message 12 of 23

EliANewlines
Advocate
Advocate

sorry about that, see image of layerstate manager with all option showing:

 

EliANewlines_0-1723662174428.png

 

0 Likes
Message 13 of 23

pendean
Community Legend
Community Legend

@EliANewlines wrote:

Additionally, it isn't due to any other checkboxes in the layerstate manager. This is what my manager looks like:


That's only half the pop-up, open the other half

pendean_0-1723662095556.png

 

pendean_1-1723662174610.png

 

 

0 Likes
Message 14 of 23

cadffm
Consultant
Consultant

Hi,

 

what is this!?

In door file, th elayers are in use

In hostfile, they didn't ??

cadffm_0-1723662213723.png

 

Sebastian

0 Likes
Message 15 of 23

EliANewlines
Advocate
Advocate

see above

0 Likes
Message 16 of 23

EliANewlines
Advocate
Advocate

The only layer in use is "A-BLDG". I assume the reason they show as "in-use" in the original xref is because they are used in civil 3d styles or such.

0 Likes
Message 17 of 23

pendean
Community Legend
Community Legend

@EliANewlines wrote:

The only layer in use is "A-BLDG". I assume the reason they show as "in-use" in the original xref is because they are used in civil 3d styles or such.


I think we are at the stage where we need access to your DWG files please.

0 Likes
Message 18 of 23

EliANewlines
Advocate
Advocate

No problem. There's nothing special in them, I created them from scratch for the purpose of this question. eTransmit is kinda overkill, so I'll leave it to you to xref "door" into "door host".

0 Likes
Message 19 of 23

cadffm
Consultant
Consultant

Hi,

 

update

My first tests I did in 2021 (Acad), but now I was able to reproduce your issue in 2025-2022

AND 2021 too! Oh.

So there is something depending, we have to search for it.

 

It has nothing to do with Visretain/Visretainmode (and also not with xrefoverride)

But this time I used CIVIL3D (2025) to create this sample.. what working wrong also in my ACAD2021

hmm,

Sorry, I don't have more time for it, but I attach my other sample, what working well .

Please test it on your side with my files.

 

 

Sebastian

0 Likes
Message 20 of 23

EliANewlines
Advocate
Advocate
Accepted solution

@cadffm 

 

When I used your drawings, it worked fine! I was scratching my head for a few minutes, and I finally figured it out:

 

When the layerstate is created by using the "edit" option in layerstate manager, then it doesn't work. It only creates the fake xref overrides that don't show up in layer properties. However, when the layerstate is created by first making xref overrides then creating the layerstate (which by default takes the current layer properties), then it keeps the overrides and applies real xref overrides when it is restored.

 

My layerstates were made using the "edit" menu, and your layerstates were made by taking the current layer properties which already had xref overrides.

 

It's unfortunate that the "edit" menu is practically worthless for xrefs because of this bug, but it's something I can work with. I'll just make my layerstates the other way.

 

Thank you so much for your help!

0 Likes