Results 1 to 7 of 7

Thread: Auto-change xref Layer Settings?

  1. #1
    Active Member
    Join Date
    2008-01
    Posts
    67
    Login to Give a bone
    0

    Default Auto-change xref Layer Settings?

    Hi,

    Ok, let's say I have an xref for a mechanical plan. The mechanical plan has many different colors, but as an xref on another plan, it will be background weight. So, I change all the layers in the host drawing to color '8' as per our standard. But, when work is added to the mechanical plan using a layer that did not previously exist, the newly-added layers propagate as their original colors to the host drawing.

    Is there a way to assign a specific color to newly added layers for an xref? Additional work gets drawn in using a new layer with any color, but the host drawing would automatically convert the colors to '8'.

    Thanks,
    Paul

  2. #2
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    Don't know of anything that does this automatically, but that's the reasoning behind the Reconcile Layers feature in 2008. It basically tells you which layers were added since you last reconciled the layers.

    The only way I can think of to get this automatically is to create a LISP reactor with the (vlr-xref-reactor ...) then check the :VLR-beginRestore and :VLR-endRestore reactions. Change Layer settings of new layers to the "default" which you'll have to save somewhere in the drawing (maybe a dictionary or such).

  3. #3
    AUGI Director scott.wilcox's Avatar
    Join Date
    2015-11
    Location
    Edmonton, Alberta
    Posts
    990
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    You need to set VISRETAIN in the host drawing to 1.

    Type: Integer
    Saved in: Drawing
    Initial value: 1
    Controls the visibility, color, linetype, lineweight, and plot styles (if PSTYLEPOLICY is set to 0) of xref-dependent layers.

    0 The layer table, as stored in the reference drawing (xref) takes precedence. Changes made to xref-dependent layers in the current drawing are valid in the current session only and are not saved with the drawing. When the current drawing is reopened, the layer table is reloaded from the reference drawing and the current drawing reflects those settings. The layer settings affected are On, Off, Freeze, Thaw, Color, Ltype, LWeight, and PStyle (if PSTYLEPOLICY is set to 0).
    1 Xref-dependent layer changes made in the current drawing take precedence. Layer settings are saved with the current drawing's layer table and persist from session to session.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    Quote Originally Posted by scott.wilcox View Post
    You need to set VISRETAIN in the host drawing to 1.
    Ummm.... Scott, the OP was asking about newly created XREF layers and not ones that were already in the XREF drawing.

    Your suggestion would be for layers created before the reference had been made or the layers had been reconciled in some fashion.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    It's not really a technology problem - it's an education one.

  6. #6
    AUGI Director scott.wilcox's Avatar
    Join Date
    2015-11
    Location
    Edmonton, Alberta
    Posts
    990
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    Quote Originally Posted by Opie View Post
    Ummm.... Scott, the OP was asking about newly created XREF layers and not ones that were already in the XREF drawing.

    Your suggestion would be for layers created before the reference had been made or the layers had been reconciled in some fashion.
    Oh, you're right.

    Never mind.

  7. #7
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Auto-change xref Layer Settings?

    Ok, here goes ... I've made a LISP routine which checks new layers of an XRef every time it is reloaded.

    You need to save both attached files to one of your Support Paths (see in Tools --> Options --> Files (tab) --> Support File Search Path). Then add the XRefLayers.lsp file to the Startup Suite (in Tools --> Load Application --> Startup Suite --> Contents (button)). After this the LISP routine loads whenever you start AutoCAD - so restart AC for now.

    You 1st set the defaults as you want through the XRefLayerDefaults command. It opens a dialog listing all XRefs loaded. By picking an XRef & changing the settings on the right, then click Add to save these settings for that XRef. Once you're done, click OK to close the dialog.

    Now open the XRef and add a new layer, make it's color / linetype / whatever different from what you've selected in XRefLayerDefaults. Draw some entities on it with props set to ByLayer, save & close. Reload the XRef ... that layer should now have the settings as per your default selection instead of what's in the original file.

    Added new layer check when opening the file (otherwise you always had to reload the XRef). Also added a command XRefLayerChanges, to see which layers were changed and allowing you to undo that change for each of those layers.
    Attached Files Attached Files
    Last edited by irneb; 2008-06-06 at 10:56 AM. Reason: Added drawing open & undo capability

Similar Threads

  1. 2013: XREF not bringing in layer settings
    By ron_hecht382200 in forum AutoCAD LT - General
    Replies: 2
    Last Post: 2013-01-14, 11:32 PM
  2. SSM, layer and xref settings
    By Christopher_L in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2008-11-02, 12:22 PM
  3. saving xref layer settings
    By siwincan in forum AutoCAD General
    Replies: 3
    Last Post: 2008-06-24, 05:22 AM
  4. Replies: 6
    Last Post: 2007-05-30, 05:45 PM
  5. Restore XREF's layer settings
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2006-04-30, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •