Results 1 to 2 of 2

Thread: New Layer with filter applied

  1. #1
    Wish List Administration
    Join Date
    2011-08
    Posts
    4,581

    Default Re: New Layer with filter applied

    Summary: New Layer with filter applied in layer properties manager

    Description: If I was in the layers property manager and had a filter applied. I then want to create a new layer which would likely contain the properties requirements of said filter which most of time it is the name or part of name. Currently when you create a new layer because by default it doesn't contain the name it is automatically hidden. My proposal is that even though you have a filter applied the new layer even though it does not follow the naming convention yet of the applied filter would still be visible. It can be hidden if you leave unnamed or change to something that doesn't fulfill filter requirements when you close the layer property manager and reopen it.

    Product and Feature: AutoCAD - Layer

    Submitted By: wrmarshall on 01/25/2023


  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658

    Default Re: New Layer with filter applied

    I add Layer* to most of my Layer Filters for that reason.
    No matter which one is active they don't filter out a new layer unless you rename it to something that filters it out.

    Lisp example:
    Code:
    ; (load "LayFilterAdd.lsp")
    ; ^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==\"[A,C,E,L,V]-*\" 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)

Posting Permissions

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