I've created the script below that will create a layer filter with one definition. (ie, it filters layers with "lay" in their name).
I'd like to have several layers called (for example all layers containing text, which may be named "*tx*" , "*dm*", and "*rm*")
however, everytime I attempt to "edit" the filter it simply overwrites the last option, rather than adding to it.
in other words, I can only filter ONE layer at a time, instead of 2 or more in one filter.
any suggestions? I would also accept a LISP solution.
thank you,
-LAYER
FILTER
NEW
PROPERTY
NAME
;;; NAME YOUR FILTER
MYFILTER
;;; EDIT YOUR FILTER
E
;;; YOUR FILTER NAME
MYFILTER
D
NAME=="*LAY*"
x
Here is one of my filters as an example:
(defun c:LayerFilterXref () (command "_.LAYER" "_FILTER" "_N" "_P" "All" "NAME==\"_.xref*\" OR NAME==\"Layer*\"" "Xrefs IN") (if (> (getvar 'CMDACTIVE) 0) (command "")) ; this was just in case (i think) if the filter already exists (princ) )
Hey @ВeekeeCZ
Do you know how to access the On/Off, Freeze/Thaw, Locked/Unlocked properties using this method? the "NAME==" function is working well, but i can't seem to find anything about the other properties. Also, I can't figure out the syntax of the name portion. Any input would be appreciated."NAME==\"_.xref*\" OR NAME==\"Layer*\""
@ВeekeeCZ wrote:
Here is one of my filters as an example:
(defun c:LayerFilterXref () (command "_.LAYER" "_FILTER" "_N" "_P" "All" "NAME==\"_.xref*\" OR NAME==\"Layer*\"" "Xrefs IN") (if (> (getvar 'CMDACTIVE) 0) (command "")) ; this was just in case (i think) if the filter already exists (princ) )
Thanks a lot sir,
Can you please make this code for user input at command prompt for filter name and what type of layers to be filtered with wildcart. Advanced thanks.
@DeeusJayus-ISX wrote:
Hey @ВeekeeCZ
Do you know how to access the On/Off, Freeze/Thaw, Locked/Unlocked properties using this method? ...
Sure, see the example:
"OFF==\"False\" AND FROZEN==\"False\""
@tnvsb wrote:
Thanks a lot sir,
Can you please make this code for user input at command prompt for filter name and what type of layers to be filtered with wildcart. Advanced thanks.
Try this one. Not sure is you want to the filter also current... if not, comment out the last line. HTH
(defun c:LayerFilter (/ name flt) (setq name (getstring T "\nFilter name: ")) (setq flt (getstring T "\nLayer mask: ")) (command "_.LAYER" "_FILTER" "_Delete" name "") (if (> (getvar 'CMDACTIVE) 0) (command "")) (command "_.LAYER" "_FILTER" "_New" "_Property" "All" (strcat "NAME==\"" flt "\"") name) (if (> (getvar 'CMDACTIVE) 0) (command "")) (command "_.LAYER" "_FILTER" "_S" "All" "") (command "_.LAYER" "_FILTER" "_Set" name) (if (> (getvar 'CMDACTIVE) 0) (command "")) (princ) )
Dear Experts,
I used to create layer filters from Excel input to autocad from one lisp program in my past company. But I lost that lisp programme. If you have such type of program, can you please share me. Please have a look on attachments. Advanced thanks.