Jump to content

Get color name from hatch.


Juergen

Recommended Posts

Hi users,

 

I´m looking to get the color bookname and color name from

selected hatch and write the name as text into

the drawing. (see images)

 

Can anybody help.

 

Thanks.

 

Juergen.

 

attachment.php?attachmentid=63797&cid=1&stc=1

 

attachment.php?attachmentid=63798&cid=1&stc=1

 

attachment.php?attachmentid=63799&cid=1&stc=1

img_01.jpg

img_02.jpg

img_03.jpg

Link to comment
Share on other sites

Another, which should account for everything...

(defun objectcolour ( enx / col )
   (cond
       (   (cdr (assoc 430 enx)))
       (   (setq col (cdr (assoc 420 enx)))
           (mapcar '(lambda ( x ) (lsh (lsh (fix col) x) -24)) '(8 16 24))
       )
       (   (setq col (cdr (assoc 62 enx))))
       (   (objectcolour (entget (tblobjname "layer" (cdr (assoc 8 enx))))))
   )
)

 

To test:

(defun c:test ( / ent )
   (if (setq ent (car (entsel)))
       (print (objectcolour (entget ent)))
   )
   (princ)
)

Link to comment
Share on other sites

Hi ronjonp, hi Lee,

 

tanks for your help.

 

It helps me a lot to learn more about lisp.

 

 

@rkmcswain: yes it´s always a ColorBook color.

(I need it to title our color palette)

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...