Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/13/2019 in all areas

  1. Rather than applying a 'positive' layer filter which includes all layers which are turned on, thawed, and unlocked in a drawing (which is likely to comprise of many layers), I would instead suggest applying a 'negative' layer filter to exclude those layers which are turned off, frozen, or locked (which is likely to comprise of fewer layers). The following example code also accounts for viewing Modelspace through an active Paperspace viewport, and accounts for wildcard operators (such as "#") present in layer & layout names: (defun c:sa ( / l s x ) (while (setq x (tblnext "layer" (not x))) (if (or (< 0 (logand 5 (cdr (assoc 70 x)))) (minusp (cdr (assoc 62 x))) ) (setq l (cons (cons 8 (LM:escapewildcards (cdr (assoc 2 x)))) l)) ) ) (if (setq s (ssget "_X" (cons (if (= 1 (getvar 'cvport)) (cons 410 (LM:escapewildcards (getvar 'ctab))) '(410 . "Model") ) (if l (append '((-4 . "<NOT") (-4 . "<OR")) l '((-4 . "OR>") (-4 . "NOT>")))) ) ) ) (sssetfirst nil s) ) (princ) ) ;; Escape Wildcards - Lee Mac ;; Escapes wildcard special characters in a supplied string (defun LM:escapewildcards ( str ) (vl-list->string (apply 'append (mapcar '(lambda ( c ) (if (member c '(35 64 46 42 63 126 91 93 45 44)) (list 96 c) (list c) ) ) (vl-string->list str) ) ) ) ) (princ) The above uses my Escape Wildcards function.
    1 point
  2. You're welcome . But the modification by marko is correct , so please use the one he modified This one Thank you marko for your modifications Thanks
    1 point
×
×
  • Create New...