Ament Posted April 17, 2018 Share Posted April 17, 2018 Hello together, I thought I have a simple task to perform, but unfortunately it turned out to be more difficult than I expected: I have in my lisp a code to select all elements in a drawing using (setq tbe (ssget "_X")), what I want to do now is to change the color of the selectionset to have a certain color. This color is defined by the RGB code 102,204,255. Unfortunately I was not able to find the important hint to solve it by my own Thank you for your help, Ament Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 17, 2018 Share Posted April 17, 2018 Try this: (defun c:foo (/ s) (if (setq s (ssget ":L")) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (entmod (append (entget e) '((420 . 6737151)))) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted April 17, 2018 Share Posted April 17, 2018 recent thread ? by grrr & M.R Quote Link to comment Share on other sites More sharing options...
Ament Posted April 17, 2018 Author Share Posted April 17, 2018 Hi nahhphuc, unfortunately I'm a beginner in LISP and not able to identify the relevant code in the threat you mentioned Could you give me the hint? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted April 17, 2018 Share Posted April 17, 2018 http://www.lee-mac.com/runlisp.html you can try copy the entire code by Ronjonp @ post#2 (shorter) paste to command line to invoke type, command : foo or (c:foo) Quote Link to comment Share on other sites More sharing options...
Grrr Posted April 17, 2018 Share Posted April 17, 2018 Back then, when I was learning about grread: Grread + RGB (featuring the help of two giants). Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 18, 2018 Share Posted April 18, 2018 To convert the rgb use lee-mac function ;; RGB -> True - Lee Mac ;; Args: r,g,b - [int] Red, Green, Blue values (defun LM:RGB->True ( r g b ) (logior (lsh (fix r) 16) (lsh (fix g) (fix b)) ) ;(setq rgb (LM:RGB->True R G B)) (setq rgb (LM:RGB->True 102 204 255)) ;6737151 Quote Link to comment Share on other sites More sharing options...
Ament Posted July 3, 2018 Author Share Posted July 3, 2018 Wonderfull. It works just perfectly for me. Thanks again! Quote Link to comment Share on other sites More sharing options...
Solitechcadsolutions Posted July 3, 2018 Share Posted July 3, 2018 autocad chprop command would change the selected item color. is I am missing something ? Quote Link to comment Share on other sites More sharing options...
rlx Posted July 3, 2018 Share Posted July 3, 2018 autocad chprop command would change the selected item color. is I am missing something ? yeah , you're missing all the fun of trying to use no command calls Quote Link to comment Share on other sites More sharing options...
Solitechcadsolutions Posted July 3, 2018 Share Posted July 3, 2018 haha big time learner here. i know only some functions of autolisp activex functions are like god for me i know its there but don't know how to use hahahaha (need your tips for better learning). thank you Quote Link to comment Share on other sites More sharing options...
dlanorh Posted July 3, 2018 Share Posted July 3, 2018 yeah , you're missing all the fun of trying to use no command calls No, thats called Masochism. Quote Link to comment Share on other sites More sharing options...
rlx Posted July 3, 2018 Share Posted July 3, 2018 No, thats called Masochism. my wife doesn't like commands too haha Quote Link to comment Share on other sites More sharing options...
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.