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
|
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
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.
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:, 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.Code:^C^C(command "-LAYER" "filter" "New" "Group" "All" "ATDIMS,ATTEXT,ATVEHICLE,AutoTURN,TSCONFLICT,TSINVISION,TSOBSTACLE,Veh-P" "AutoTurn" "eXit" "")
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)
Last edited by Tom Beauford; 2020-08-10 at 10:47 PM.
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:
(Sorry, not sure of the Registry key for vanilla AutoCAD)Code:Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R23.0\ACAD-2000:409\Applications\AcLayer\Extensions] "ADT"="AecLayerManagerEx.dll"
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:
"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
works for seeing what "ADT" is set to.Code:(vl-registry-read "HKEY_LOCAL_MACHINE\\SOFTWARE\\Autodesk\\AutoCAD\\R23.0\\ACAD-2000:409\\Applications\\AcLayer\\Extensions" "ADT")
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?
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.
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
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.