Saqib_theleo Posted September 15, 2018 Posted September 15, 2018 Hello all there, I have a Lisp "Select objects by color" which i downloaded from internet, exactly i don't remember from where. (defun c:sbc ( / c d e l ) (if (setq e (car (entsel))) (progn (setq c (cond ( (cdr (assoc 62 (entget e))) ) ( (abs (cdr (assoc 62 (tblsearch "LAYER" (cdr (assoc 8 (entget e))))))) ) ) ) (while (setq d (tblnext "LAYER" (null d))) (if (= c (abs (cdr (assoc 62 d)))) (setq l (cons "," (cons (cdr (assoc 2 d)) l))) ) ) (sssetfirst nil (ssget "_X" (if l (list (cons -4 "<OR") (cons 62 c) (cons -4 "<AND") (cons 62 256) (cons 8 (apply 'strcat (cdr l))) (cons -4 "AND>") (cons -4 "OR>") ) (list (cons 62 c)) ) ) ) ) ) (princ) ) This Lisp works fine for all objects of drawing. First it asks for select object (which color we want to select) then it selects all objects in the drawing of same color. I want that after selecting color it asks for selection window instead of all drawing. If someone can help me modify this lisp I'll be thankful. Thank you. Quote
JuniorNogueira Posted September 15, 2018 Posted September 15, 2018 Try removing "_X" (ssget "_X" (if l ... Quote
Saqib_theleo Posted September 16, 2018 Author Posted September 16, 2018 Hello JuniorNogueira, thanks for your reply, i removed "_X" and it's now working as i wanted. thanks for helping. thank you.. Quote
BIGAL Posted September 17, 2018 Posted September 17, 2018 For your future info look up help about SSGET its has a lot of filter options X W CP WP etc. Quote
BrianTFC Posted September 17, 2018 Posted September 17, 2018 this is a helpful lisp but what if you wanted to select by layer the same way? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.