Jump to content

COLOR LINE ...


leonucadomi

Recommended Posts

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?

 

 

image.thumb.png.d7e0b45162bf0c291e7e8c5c06e6c986.png

image.png

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 by ronjonp
  • Like 2
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...