leonucadomi Posted June 29, 2022 Share Posted June 29, 2022 HELLO I SELECT A LINE AND LOOK AT ITS PROPERTIES THE COLOR OF THE LINE IS THE SHOWN IN THE IMAGE DOES ANYONE KNOW WHAT IS THE CODE TO SEE ITS VALUE? Quote Link to comment Share on other sites More sharing options...
mhupp Posted June 29, 2022 Share Posted June 29, 2022 (edited) http://docs.autodesk.com/ACAD_E/2012/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7a62.htm (62 . 61) --edit put this in your command line (acad_colordlg 61) Edited June 29, 2022 by mhupp 3 Quote Link to comment Share on other sites More sharing options...
Edison CB Posted June 29, 2022 Share Posted June 29, 2022 Hello friend, you can work with the following code: (VL-LOAD-COM) (setq obj (vlax-ename->vla-object (car (entsel))));i take the object (vla-get-color obj);takes the color of the object (vla-put-color obj "1");sets the color of the object Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 30, 2022 Share Posted June 30, 2022 (vla-put-color obj 1) ;sets the color of the object (vla-put-color obj (acad_colordlg 1)) ;sets the color of the object 2 Quote Link to comment Share on other sites More sharing options...
ronjonp Posted June 30, 2022 Share Posted June 30, 2022 (edited) Here's another way to set layer colors with a pick... will do index, truecolor and colorbooks. Could easily be modified to set the object color. (defun c:clc (/ c d e l n) ;; RJP » 2018-08-17 ;; Set layer color by pick (or (getenv "clc") (setenv "clc" "(62 . 1)")) (cond ((setq c (acad_truecolordlg (read (getenv "clc")))) (setenv "clc" (vl-prin1-to-string (last c))) (setq d (vla-get-activedocument (vlax-get-acad-object))) (while (setq e (nentsel "\nSelect entity to change layer color: ")) (foreach x (append (list (car e)) (cadddr e)) (cond ((setq n (cdr (assoc 8 (entget x)))) (setq l (tblobjname "layer" n)) (and (not (wcmatch n "0")) (entmod (append (entget l) c))) ) ) ) ) (vla-regen d acactiveviewport) ) ) (princ) ) Edited June 30, 2022 by ronjonp 2 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.