See the top rated post in this thread. Click here

Results 1 to 4 of 4

Thread: Script to manipulate layers in multiple x-refs

  1. #1
    Member
    Join Date
    2015-10
    Posts
    2
    Login to Give a bone
    0

    Default Script to manipulate layers in multiple x-refs

    Hi all,

    I am currently working on my first script attempting to change specific xref dependent layer properties to show as needed in my drawings.
    We had a similar script at my previous place of employment so I know it can be done but am having trouble because the changes are made to all xrefs in the dwg.

    Concrete plan - Concrete level below gets xref'd and named X-CONC-B
    Wood frame plan - Wood level above gets x-ref'd and named X-WOOD-A

    All but a few layers are turned off.
    Remaining layers have colour changed and linetype changed to hidden or hidden2.

    Trouble is that layers are the same in other xrefs (X-GRIDS, X-SCHEDULES etc..)

    This is what I have and it works for the layer changes I want but, turns off all layers that begin with S-,~- & BDR- in other xrefs I don't want to edit.:

    Code:
    -LAYER C 40
    *|X-*
    L HIDDEN
    *|X-CONC-B|S-CWALL*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*
    L HIDDEN2
    *|S-CCOL*,*|S-SCOL*,*|S-WPOST*,*|S-WHAT*
    C 3
    *|S-CCOL*,*|S-SCOL*
    C 254
    *|S-ARCH*
    F
    *|S-*,*|~-*,*|BDR-*
    T
    *|S-CWALL*,*|S-CCOL*,*|S-SCOL*,*|S-WHAT*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*,*|0*,*|S-ARCH*
    Is there a way to tweak so I turn off layers in X-WOOD-A AND X-CONC-B only?
    For example the layer ~TXT20 exists in all xrefs.

    Code:
    X-CONC-B|~TXT20
    X-WOOD-A|~TXT20
    xxxx-xxx-X-Schedules|~TXT20
    (lower case x's = project number)

    Thanks for helping a noob to script writing.
    Marlon
    Last edited by BlackBox; 2021-10-05 at 07:15 PM. Reason: Please use [CODE] Tags

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    1

    Default Re: Script to manipulate layers in multiple x-refs

    Not sure if I fully understand what you're asking for, but sounds like you're wanting to change this:

    Code:
    -LAYER C 40
    *|X-*
    L HIDDEN
    *|X-CONC-B|S-CWALL*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*
    L HIDDEN2
    *|S-CCOL*,*|S-SCOL*,*|S-WPOST*,*|S-WHAT*
    C 3
    *|S-CCOL*,*|S-SCOL*
    C 254
    *|S-ARCH*
    F
    *|S-*,*|~-*,*|BDR-*
    T
    *|S-CWALL*,*|S-CCOL*,*|S-SCOL*,*|S-WHAT*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*,*|0*,*|S-ARCH*
    To this:
    Code:
    -LAYER C 40
    *|X-*
    L HIDDEN
    *|X-CONC-B|S-CWALL*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*
    L HIDDEN2
    *|S-CCOL*,*|S-SCOL*,*|S-WPOST*,*|S-WHAT*
    C 3
    *|S-CCOL*,*|S-SCOL*
    C 254
    *|S-ARCH*
    F
    X-WOOD-A|S-*,X-WOOD-A|~-*,X-WOOD-A|BDR-*,X-CONC-B|S-*,X-CONC-B|~-*,X-CONC-B|BDR-*
    T
    *|S-CWALL*,*|S-CCOL*,*|S-SCOL*,*|S-WHAT*,*|S-WWALL*,*|S-WSW*,*|S-WOUTLINE*,*|0*,*|S-ARCH*
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2015-10
    Posts
    2
    Login to Give a bone
    0

    Red face Re: Script to manipulate layers in multiple x-refs

    Hi Blackbox,

    That did it!
    I had tried a variation of the line in blue but somehow had the symbols in the wrong order.

    Thank you so much.

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Script to manipulate layers in multiple x-refs

    Quote Originally Posted by Macoy_ View Post
    That did it!
    I had tried a variation of the line in blue but somehow had the symbols in the wrong order.

    Thank you so much.
    Happy to help.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. 2015: AutoCAD LT Script that changes multiple attributes across multiple drawings
    By alecgburke704194 in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2015-06-30, 12:21 PM
  2. Replies: 2
    Last Post: 2013-05-23, 01:26 PM
  3. Manipulate Leader associated with a Block
    By afortier in forum AutoCAD General
    Replies: 3
    Last Post: 2005-04-29, 01:14 PM
  4. View X-refs When Isolating Layers
    By lhood in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2005-01-19, 10:41 AM
  5. HOW TO MANIPULATE CONTOURS?
    By jwilhelm in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-08-10, 05:44 PM

Tags for this Thread

Posting Permissions

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