See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Importing Layer Filters into multiple drawings

  1. #1
    Member
    Join Date
    2011-03
    Posts
    9
    Login to Give a bone
    0

    Question Importing Layer Filters into multiple drawings

    I have a series of layer filters I would like to add to many drawings any know how I could do that instead individually?

    Thanks

  2. #2
    I could stop if I wanted to
    Join Date
    2015-05
    Location
    West Des Moines
    Posts
    306
    Login to Give a bone
    1

    Default Re: Importing Layer Filters into multiple drawings

    In the drawing that has the filters you want run the layersavefiltertree command and save it out.

    In the drawing that doesn't have the filters run the layerloadfltertree command and drop it in.

    Edit: Not very intuitive design, but easy enough to do.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Importing Layer Filters into multiple drawings

    The one drawback to LayerLoadFilterTree is that it deletes the existing Filters. I've attached images for LayerLoadFilterTree and LayerSaveFilterTree CUI macros.

    Add a CUI macro like:
    Code:
    ^C^C(command "-LAYER" "filter" "New" "Group" "All" "ATDIMS,ATTEXT,ATVEHICLE,AutoTURN,TSCONFLICT,TSINVISION,TSOBSTACLE,Veh-P" "AutoTurn" "eXit" "")
    , but include your own layer list and replace "AutoTurn" with whatever you want to name the filter. You can enter "-LAYER" on the command line to experiment with the many options as well.

    For simply picking a Layer Filter use "+LAYER" on the command line.

    There are many lisp options like:

    EXPFLTR & IMPFLTR (gile)
    Export and import property layer filters
    http://forums.augi.com/showthread.ph...l=1#post952247
    EXPFLTR
    Exports a layer filter datas from the current drawint to a file (.flt)

    For importing a group of commonly used Filters:
    Code:
    ; ^C^C^P(or LayFilterAdd (load "LayFilterAdd.lsp"));(LayFilterAdd)
    ; Newer versions automatically display Xref Layer Filters **Adding Xref Layer Filter names the same as them can cause serious issues**
    ; Save, close and reopen the DWT or DWG for the Filters to be put into alphabetical order.
    (defun LayFilterAdd (/ collection names)
    ;  (load "LFD.lsp")
    ;  (command "C:LFD" "All*") *Layers
      (setq names (list ""))
      (if (not (vl-catch-all-error-p (setq collection (vl-catch-all-apply
        (function (lambda () (vla-item (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "ACAD_LAYERFILTERS")))
      ))))
    ;  (vlax-for item collection (setq names (cons (strcase (vla-get-name item)) names))))
      (vlax-for item collection (setq names (cons (vla-get-name item) names))))
      names 
      (or(member "CALC Points" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"V-NODE-CALC\" or NAME== \"Layer*\"" "CALC Points" "X" nil))
      (or(member "HATCH No xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"*HATCH\"" "HATCH No xrefs" "X" nil))
      (or(member "Linetype" names)(command "._-layer" "filter" "new" "property" "All" "LINETYPE==\"~Continuous\"" "Linetype" "X" nil))
      (or(member "Lineweight" names)(command "._-layer" "filter" "new" "property" "All" "LINEWEIGHT==\"~Default\"" "Lineweight" "X" nil))
      (or(member "NCS" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"[A,C,E,L,V]-*\" or NAME== \"Layer*\"" "NCS" "X" nil))
      (or(member "NCS No xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"[A,C,E,L,V]-*\" or NAME== \"Layer*\"" "NCS No xrefs" "X" nil))
      (or(member "No NCS" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~[A,C,E,L,V]-*\"" "No NCS" "X" nil))
      (or(member "No NCS or xrefs" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"~[A,C,E,L,V]-*\"" "No NCS or xrefs" "X" nil))
      (or(member "No NODE" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"[A,C,E,L,V]-*\" and NAME==\"~*-NODE*\" or NAME== \"Layer*\"" "No NODE" "X" nil))
      (or(member "NODE" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"~*|*\" and NAME==\"*-NODE*\" or NAME== \"Layer*\"" "NODE" "X" nil))
      (or(member "Profile" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-ROAD-PROF*\" or NAME== \"Layer*\"" "Profile" "X" nil))
      (or(member "Sections" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-ROAD-SEC*\" or NAME== \"Layer*\"" "Sections" "X" nil))
      (or(member "Topo" names)(command "._-layer" "filter" "new" "property" "All" "NAME==\"C-TOPO*\" or NAME== \"Layer*\"" "Topo" "X" nil))
      (princ "Layer Filter Names » ")(princ names)
    ;  (princ "\nSave, close and reopen the DWT or DWG for the Filters to be put into alphabetical order.")
      (princ)
    ); function
    (LayFilterAdd)
    Attached Images Attached Images
    Last edited by Tom Beauford; 2020-08-10 at 10:47 PM.

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

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by CCarleton View Post
    In the drawing that has the filters you want run the layersavefiltertree command and save it out.

    In the drawing that doesn't have the filters run the layerloadfltertree command and drop it in.

    Edit: Not very intuitive design, but easy enough to do.
    Not very intuitive, because AutoCAD products don't install Layer Manager Extensions OOTB.

    As example, to load the extensions for Civil 3D 2019 set this in the Registry:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R23.0\ACAD-2000:409\Applications\AcLayer\Extensions]
    "ADT"="AecLayerManagerEx.dll"
    (Sorry, not sure of the Registry key for vanilla AutoCAD)


    Once loaded, the Layer Manager buttons are:

    Layer Standards, Layer Key Styles, Layer Key Overrides, Load Filter Groups, Save F&ilter Groups, New &Property Filter (Alt+ P), New &Group Filter (Alt+ G), New Standards Filter, Layer &States Manager (Alt+ S), &New Layer (Alt+ N), New Layer From Standard, &New Layer VP Frozen in All Viewports, &Delete Layer (Alt+ D), Set &Current (Alt+ C), etc

    ... Yes, the AutoCAD Team seems to implement an incorrect usage of "&" in several button tooltips. Haha


    Here's a quick before and after:
    Attached Images Attached Images
    "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

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by BlackBox View Post
    Not very intuitive, because AutoCAD products don't install Layer Manager Extensions OOTB.

    As example, to load the extensions for Civil 3D 2019 set this in the Registry:

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R23.0\ACAD-2000:409\Applications\AcLayer\Extensions]
    "ADT"="AecLayerManagerEx.dll"
    Code:
    (vl-registry-read "HKEY_LOCAL_MACHINE\\SOFTWARE\\Autodesk\\AutoCAD\\R23.0\\ACAD-2000:409\\Applications\\AcLayer\\Extensions" "ADT")
    works for seeing what "ADT" is set to.

    While I was able to set it with Regedit which worked vl-registry-write (AutoLISP) Help says "You cannot use vl-registry-write for HKEY_USERS or KEY_LOCAL_MACHINE." so I'm clueless on how to add it for others.

    Load Filter Groups & Save Filter Groups allow you to work with multiple sets of Layer Filters while LayerLoadFilterTree and LayerSaveFilterTree are for one set only. Both automatically delete the existing Filters though.

    I remember them being experimental and showing up in 2015 accidentally. They were removed with an update and I haven't seen them again till now.

    Has there ever been a help link for these additional extensions?

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

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by Tom Beauford View Post
    ... so I'm clueless on how to add it for others.
    Using the .REG file I posted above (for those using Civil 3D, etc; no idea how to add for vanilla AutoCAD)? Haha

    To quickly implement for all CAD users, you can leverage REG ADD in your NETLOGON script, or GPO to do same at login.

    Quote Originally Posted by Tom Beauford View Post
    Has there ever been a help link for these additional extensions?
    No idea - I only stumbled upon this recently (Monday?), thanks to a post by David Blanchard - I only really paid attention to it as I was working on my Block Editor Tools (which I started back in 2015 and apparently never published?! ) that automagically appends the Block name to contextual Block Editor tab and adds a new Layer Filter & sets it current for only those Layers found in the Block being edited, then restores the previous tree on BCLOSE.

    Cheers
    "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

  7. #7
    Member
    Join Date
    2017-05
    Posts
    19
    Login to Give a bone
    0

    Default Re: Importing Layer Filters into multiple drawings

    Is there a way to unload filter groups, or load the default one? I loaded one and seems to have come in erroneously. There are duplicate and if I click on one (topmost All non-Xref Layers) it will crash Civil3d
    LayerFilter.PNG
    Thanks

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by Sterling2017 View Post
    Is there a way to unload filter groups, or load the default one? I loaded one and seems to have come in erroneously. There are duplicate and if I click on one (topmost All non-Xref Layers) it will crash Civil3d
    LayerFilter.PNG
    Thanks
    How were you able to do load a duplicate filter?

  9. #9
    Member
    Join Date
    2017-05
    Posts
    19
    Login to Give a bone
    0

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by Tom Beauford View Post
    How were you able to do load a duplicate filter?
    Just <layersavefltertree> from desired file and <layerloadfltertree> into this one. Once loaded duplicates came in, I thought they would be overwritten, but now they crash cad.

  10. #10
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    1

    Default Re: Importing Layer Filters into multiple drawings

    Quote Originally Posted by Sterling2017 View Post
    Is there a way to unload filter groups, or load the default one? I loaded one and seems to have come in erroneously. There are duplicate and if I click on one (topmost All non-Xref Layers) it will crash Civil3d
    LayerFilter.PNG
    Thanks
    Recent versions of AutoCAD have Xref Layer Filters "All non-Xref Layers", "Xref Overrides", and under "Xref" each Xref file as a Layer Filter added automatically when an Xref is attached to a drawing. Since this feature was added there have been many who have had issues with importing Layer Filters that contained ones with the same names as ones created automatically by AutoCAD. A Google search for Duplicate "All non-Xref Layers" layer filter returns quite a few of them. Sadly no solution has been found that I've seen. Best I can tell you is to make sure whatever method you're using doesn't have any Layer Filters included with the same layer names.

    Have you tried to Audit or Recover the drawing?

    I'd avoid importing Layer Filters with the layer name "All Used Layers" as well.
    Last edited by Tom Beauford; 2019-05-31 at 12:27 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. 2010: Can I use layer group filters for layer translation (LAYTRANS)?
    By Besni in forum AutoCAD General
    Replies: 4
    Last Post: 2013-10-04, 06:52 AM
  2. View Filters Overriding Phase Filters
    By tracyt in forum Revit MEP - General
    Replies: 1
    Last Post: 2012-03-02, 12:59 AM
  3. Importing AutoCAD 2D drawings into an Inventor drawing file
    By jimmy.long in forum Inventor - General
    Replies: 3
    Last Post: 2009-01-09, 03:01 PM
  4. TIP - Importing Drawings into Project Navigator
    By burchd in forum Project Navigator
    Replies: 2
    Last Post: 2008-04-25, 05:56 PM
  5. Importing & Exporting Layer Filters?
    By brian.young in forum AutoCAD General
    Replies: 4
    Last Post: 2004-06-29, 03:07 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
  •