We recently upgraded from 2006 to 2013. We had a lisp routine in 06 that would reload all the xref's in a sheet so the layer states would update since simply reloading the xref did not always work. Below is the code we used. Now, in 2013, when we run it, I lose all layer states. Is there something I am missing here? Thanks for the help.
(defun c:xrl ()
(setvar "visretain" 0)
(command "xref" "reload" "*")
(setvar "visretain" 1)
Solved! Go to Solution.
switching VISRETAIN to 0 also loses layer-information for XRef-depending layers, also in 2006
- alfred -
True, but then the routine reloads the xref, which should bring back all the layer states from the referenced file. This is what is not happening.
We do it to manage any overrides that are on the sheet file. We turn it off and save to relase the restraints. We then reload the xref (which when it worked in 06, would reload it completly with all layer states and specific layer changes). We then turn visretain back on so that furutre changes made to the base file would in theory show in the the sheet file. The problem I have it that it blows out the layer states on reload.
Does 2006 release include settings for auto-purging layer states? I think this might be a case of new settings being left in a default value which conflicts with your intended work flow.
All base files were created in 2013 so there is no coversion of layer states. Attached are 3 shots. One is the layer states in the base file, one is the sheet file layer states before running the routine and the third is after. You can see it blows out all my layer states. The only thing I can think of is that Autodesk made changes to the visretain command. The routine worked great in 06.
Thanks for the detailed follow up: you'll have to see if anyone has an older AutoCAD version to verify, but I can repeat yourn exact description/problem in 2011 and 2012, as well as 2013 here. This only happens when the LayerStates are created in the file to be XREFed, instead of the top file.
So my guess is this behavior changed somewhere between R2007 and R2010.
This is my first post, and forgive me if I may be too late offering advice for you, but I believe I figured out a way to get the embedded X-Ref Layer States to recognize again in the other drawings that could be put to use in the future.
In the actual X-Ref/Base drawing, activate/turn on one of the saved Later States and resave the X-Ref file. Then, back in the drawing with the X-Ref attachment, reload the X-Ref and all embedded layer states from the X-Ref should now reappear.
VisRetain does not apply at all for this to work. I just double checked to make sure this worked for me.
So, to anyone else encountering this problem, please respond to confirm whether or not this method worked for you.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.