FILTER-command
In version 7 there was a command "FILTER", to select for instance all hatchings. This does not work any more in version 8. Is there a replacement for it, or will there be ?
Comments
-
We are working on a new Quick Select dialog which will offer complete control to establish selection sets. Expected to be released in a few months.
0 -
I think the SELECT BY PROPERTIES option of the SELECT command does exactly the same ...
0 -
That "Select by Properties" function selects all entities with the specified property. I haven't found any way to use it to filter a window or crossing selection. Is there a way to do that, Louis?I made some simple lisp commands to filter selections, which anyone is welcome to use. You can easily modify them to suit your own needs.I was planning to combine them all into a single command that allows two or more filters to be applied to the same selection set. But if it's going to be built-in in a few months, it's not worth the effort.I haven't seen any problems with these in the version I've been using, which is 8.2.6:
;;; --- QL creates a selection set filtered for a specified layer;;; -----------------------------------------------------(defun c:QL () (sssetfirst nil nil)(princ " selects only entities on a specified Layer. Available layer names: ")(setq Lyrlist (vla-get-Layers (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Lyr1 Lyrlist (princ (vla-get-Name Lyr1)) (princ ", ") )(setq LA (getstring "\nEnter layer to select:"))(setq PR (cons 8 LA))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QC creates a selection set filtered for a specified color;;; -----------------------------------------------------(defun c:QC () (sssetfirst nil nil)(princ " selects only entities with a specified color number, such as: ")(princ "\n1=Red 2=Yellow 3=Green 4=Cyan 5=Blue 6=Magenta 7=White 8=Dark 9=Light 256=ByLayer 0=ByBlock.")(setq CO (getint " Enter color to select:"))(setq PR (cons 62 CO))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QY creates a selection set filtered for a specified linetype;;; -----------------------------------------------------(defun c:QY () (sssetfirst nil nil)(princ " selects only entities of a specified Linetype. Available linetype names: ")(setq Ltypelist (vla-get-Linetypes (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Ltype1 Ltypelist (princ (vla-get-Name Ltype1)) (princ ", ") )(setq LT (getstring "\nEnter linetype to select:"))(setq PR (cons 6 LT))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QW creates a selection set filtered by lineweight;;; -----------------------------------------------------(defun c:QW () (sssetfirst nil nil)(princ " selects only entities of a specified Lineweight (specified in hundredths of a mm). ")(setq MM (getint "\nEnter lineweight to select, in mm/100:"))(setq PR (cons 370 MM))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QZ creates a selection set filtered for lineweight = zero;;; (because you can't enter 0 as hundredths of a millimeter in QW);;; -----------------------------------------------------(defun c:QZ () (sssetfirst nil nil)(princ " selects only entities whose lineweight is 0.00 mm. ")(setq PR (cons 370 0))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QB creates a selection set filtered for lineweight = bylayer;;; -----------------------------------------------------(defun c:QB () (sssetfirst nil nil)(princ " selects only entities whose lineweight is Bylayer. ")(setq PR (cons 370 -1))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QT creates a selection set filtered for a specified entity Type;;; -----------------------------------------------------(defun c:QT () (sssetfirst nil nil)(princ " selects only entities of a specified Type. These abbreviations can be used: ")(princ "L=Line, P=lwPolyline, Q=Polyline, A=Arc, C=Circle, E=Ellipse, T=Text, M=Mtext, D=Dimension, J=Leader, I=Insert, H=Hatch, S=Solid")(setq ET (getstring "\nEnter Entity Type to select:"))(if (= ET "l") (setq ET "L")) (if (= ET "L") (setq ET "LINE"))(if (= ET "p") (setq ET "P")) (if (= ET "P") (setq ET "LWPOLYLINE"))(if (= ET "q") (setq ET "Q")) (if (= ET "Q") (setq ET "POLYLINE"))(if (= ET "a") (setq ET "A")) (if (= ET "A") (setq ET "ARC"))(if (= ET "c") (setq ET "C")) (if (= ET "C") (setq ET "CIRCLE"))(if (= ET "e") (setq ET "E")) (if (= ET "E") (setq ET "ELLIPSE"))(if (= ET "t") (setq ET "T")) (if (= ET "T") (setq ET "TEXT"))(if (= ET "m") (setq ET "M")) (if (= ET "M") (setq ET "MTEXT"))(if (= ET "d") (setq ET "D")) (if (= ET "D") (setq ET "DIMENSION"))(if (= ET "j") (setq ET "J")) (if (= ET "J") (setq ET "LEADER"))(if (= ET "i") (setq ET "I")) (if (= ET "I") (setq ET "INSERT"))(if (= ET "h") (setq ET "H")) (if (= ET "H") (setq ET "HATCH"))(if (= ET "s") (setq ET "S")) (if (= ET "S") (setq ET "SOLID"))(setq PR (cons 0 ET))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QS creates a selection set filtered by Text Style;;; -----------------------------------------------------(defun c:QS () (sssetfirst nil nil)(princ " selects only entities with a specified Text Style. These are the available styles: ")(setq TSlist (vla-get-Textstyles (vla-get-activedocument (vlax-get-acad-object))))(vlax-for TS1 TSlist (princ (vla-get-Name TS1)) (princ ", ") )(setq ST (getstring "\nEnter Style to select:"))(setq PR (cons 7 ST))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QD creates a selection set filtered for a specified Dimension Style;;; -----------------------------------------------------(defun c:QD () (sssetfirst nil nil)(princ " selects only entities with a specified Dimension Style. These are the available styles: ")(setq DSlist (vla-get-Dimstyles (vla-get-activedocument (vlax-get-acad-object))))(vlax-for DS1 DSlist (princ (vla-get-Name DS1)) (princ ", ") )(setq DS (getstring "\nEnter DimStyle to select:"))(setq PR (cons 3 DS))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QN creates a selection set filtered for a specified Block Name;;; -----------------------------------------------------(defun c:QN () (sssetfirst nil nil)(princ " selects only blocks, and only of a specified Name. Available names: ")(setq BlkList (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Blk1 BlkList (princ (vla-get-Name Blk1)) (princ ", ") )(setq BL (getstring "\nEnter block name to select:"))(setq ss1 (ssget '((0 . "INSERT")) (cons 2 BL)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QNX selects all insertions of a specified Block in the entire file;;; -----------------------------------------------------(defun c:QNX () (sssetfirst nil nil)(princ " selects all blocks of a specified name in the entire file. Available names: ")(setq BlkList (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Blk1 BlkList (princ (vla-get-Name Blk1)) (princ ", ") )(setq BL (getstring "\nEnter block name to select:"))(setq PR (cons 2 BL))(setq ss1 (ssget "X" '((0 . "INSERT")) (cons 2 BL)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- qE selects all the OLE images that Acad LT uses (it can't attach images).;;; -----------------------------------------------------(defun c:QE ()(princ " selects only Ole2frame entities, such as LT's OLE images. ")(setq PR (cons 0 "OLE2FRAME"))(setq ss1 (ssget (list PR)))(command "selgrips" ss1 "")) ;;; -----------------------------------------------------;;; --- qEx selects all the OLE images in the entire file.;;; -----------------------------------------------------(defun c:QEX ()(princ " ... Selecting all Ole2frame entities, such as LT's OLE images, in the entire file. ")(setq PR (cons 0 "OLE2FRAME"))(setq ss1 (ssget "X" (list PR)))(command "selgrips" ss1 "")) ;;; -----------------------------------------------------;;; --- QV selects all the viewports in a file (without selecting the layout tabs);;; -----------------------------------------------------(defun c:QV ()(princ " ... Selecting all Viewports in the entire file. ")(setq ss1 (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))(sssetfirst nil ss1)) ;;; -----------------------------------------------------
0 -
Oops. Almost immediately after posting those I happened to use one and found that it doesn't work. The QN command doesn't filter for insertions of the specified block. It just filters for any block insertion. QNX does the same. I guess I never tested them in a file that had more than one block definition.Here are revised versions of QN and QNX that seem to work the way they're supposed to. But I say that based on very little testing. Caveat emptor.
;;; --- QN creates a selection set filtered for a specified Block Name;;; -----------------------------------------------------(defun c:QN () (sssetfirst nil nil)(princ " selects only blocks, and only of a specified Name. Available names: ")(setq BlkList (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Blk1 BlkList (princ (vla-get-Name Blk1)) (princ ", ") )(setq BL (getstring "\nEnter block name to select:"))(setq PR (cons 2 BL))(setq ss1 (ssget (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------;;; --- QNX selects all insertions of a specified Block in the entire file;;; -----------------------------------------------------(defun c:testQNX () (sssetfirst nil nil)(princ " selects all blocks of a specified name in the entire file. Available names: ")(setq BlkList (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object))))(vlax-for Blk1 BlkList (princ (vla-get-Name Blk1)) (princ ", ") )(setq BL (getstring "\nEnter block name to select:"))(setq PR (cons 2 BL))(setq ss1 (ssget "X" (list PR)))(if ss1 (command "selgrips" ss1 "") (progn (princ "\n ...none found.") (princ)) )) ;;; -----------------------------------------------------
0