Registered forum members do not see this ad.
I agree completely that both FILTER and QSELECT are the most robust options, but given the specificity of the OP's request, for fun:
SelectBySS
SelectByColorCode:(defun c:SelectBySS (/ ss color) (if (and (princ "\nSelect object to select all by color: ") (setq ss (ssget ":S:E" '((-4 . "<NOT") (62 . 256) (-4 . "NOT>"))) ) (setq color (cdr (assoc 62 (entget (ssname ss 0))))) ) (sssetfirst nil (ssget "_x" (list (cons 62 color)))) (prompt "\n** Nothing selected ** ") ) (princ) )
Code:(defun c:SelectByColor (/ color ss) (if (and (princ "\nSelect objects by color: ") (setq color (acad_colordlg (atoi (getvar 'cecolor)) T)) (setq ss (ssget "_x" (list (cons 62 color)))) ) (sssetfirst nil ss) (prompt "\n** Nothing selected ** ") ) (princ) )
"Potential has a shelf life." - Margaret Atwood




There is a world of difference between WRITING a lisp, and using one.
You use lisp all the time, within the program now.
The EXPRESS TOOLS are mostly lisp programs, which you run by clicking on an icon, or entering a shortcall for it.
There is no reason to be gun-shy of USING them, they will save you lots of time and work.
Click on this link to Lee Mac's explanation of how to use them.
Once you have read the first two little bits you will understand how to do it, and use any lisp program.
After you see how easy it is, and how incredibly useful they are, go back to Lee's site and take a look at all of his wonderful lisp programs which he very generously makes available for free download there.
Thanks Lee!![]()
Volume and repetition do not validate opinions forged in the absence of thought.
Dear Dadgad
Thanks for your warm and supportive reply. You have encouraged me to go forward LISP.I am aware of its importance and benefit but I thought I am little old for studying it. But with your email I will definitely will dive into it.
Thanks a lot.
PS) This reply is one of the best replies I have ever got in this forum.![]()
Registered forum members do not see this ad.
You do not have to know how to write lisp to use it just as you do not have to know how an internal combustion engine works to drive a car.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!
Bookmarks