Author Topic: Where are color-book and items kept?  (Read 1526 times)

0 Members and 1 Guest are viewing this topic.

Pepe

  • Newt
  • Posts: 87
Where are color-book and items kept?
« on: January 10, 2011, 12:56:41 PM »
Hi everybody!

Does anybody knows which variable is where ACAD keeps the name of a color-book and item used?

I mean, if you swicth COLOR to any item included in any color book (PANTONE, RAL, etc.) and then you ask for (getvar "CECOLOR"),
you'll get a string with "RGB:RRR,GGG,BBB",but... Where is kept the book and item names  :|?

Thank you in advance!

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Where are color-book and items kept?
« Reply #1 on: January 10, 2011, 01:37:43 PM »
Perhaps this may help.

Pepe

  • Newt
  • Posts: 87
Re: Where are color-book and items kept?
« Reply #2 on: January 10, 2011, 07:17:07 PM »
Thank you for your answer, Lee Mac  :-).

Very useful functions in your link, I'll keep them in mind; but I'm afraid it is not exactly what I was looking for (maybe I've been misunderstood because of my english, or:cry:).

I just need to know the place - like "CECOLOR" for ACI and RGB colours - where the names of the color-book and selected color-book item are contained, or any other way to get both names. It should be something as the inverse of your last function "RGB->ColourName".

Thank you again!

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Where are color-book and items kept?
« Reply #3 on: January 10, 2011, 09:28:05 PM »
This is from memory

I don't believe the book name is saved as a System Variable.

The Book Name is saved in DXF 430 and one other dxf key in entities that have an explicit color set.

I had a play with this early this morning and typing -color at the command line remembered the book name last used in the current session.

The color dialog seems to remember the last book used but I imagine that is stored with the dialog ... not sure.

I did a quick search of the registry but couldn't find anything usefull.


added:
the color-util.lsp mentioned by gile is worth a good look.

« Last Edit: January 10, 2011, 09:38:00 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Pepe

  • Newt
  • Posts: 87
Re: Where are color-book and items kept?
« Reply #4 on: January 11, 2011, 03:58:48 AM »
Thank you, Kerry, for your interest!

Well, after reading your post, I deduce this is another "omission" of the program  :x.

I'll keep searching! (I'm very obstinate, and I don't give up easily  ^-^, but any help would be really appreciate!)

Pepe

  • Newt
  • Posts: 87
Re: Where are color-book and items kept?
« Reply #5 on: January 11, 2011, 05:55:36 AM »
Eureka!!!  :-o

At last I've found where colour-books and items are stored (blessed obstination): they are stored within "ACAD_COLOR" dictionary at "(namedobjdict)", but only - this is very important -  if it has been used in any entity drawn. So, if you change "_COLOR" to any item of any colour-book just at the beginning of a drawing, and you don't draw anything, there won't be any reference about that change.

IMHO is a foresight defect  :x.

I hope this should be useful for everybody.

Thank to you all, anyway  :-).