Ament Posted April 17, 2018 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
ronjonp Posted April 17, 2018 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
Ament Posted April 17, 2018 Author 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
hanhphuc Posted April 17, 2018 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
Grrr Posted April 17, 2018 Posted April 17, 2018 Back then, when I was learning about grread: Grread + RGB (featuring the help of two giants). Quote
BIGAL Posted April 18, 2018 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
Ament Posted July 3, 2018 Author Posted July 3, 2018 Wonderfull. It works just perfectly for me. Thanks again! Quote
Solitechcadsolutions Posted July 3, 2018 Posted July 3, 2018 autocad chprop command would change the selected item color. is I am missing something ? Quote
rlx Posted July 3, 2018 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
Solitechcadsolutions Posted July 3, 2018 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
dlanorh Posted July 3, 2018 Posted July 3, 2018 yeah , you're missing all the fun of trying to use no command calls No, thats called Masochism. Quote
rlx Posted July 3, 2018 Posted July 3, 2018 No, thats called Masochism. my wife doesn't like commands too haha 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.