Change RGB colors to Autocad Index Values

Change RGB colors to Autocad Index Values

Anonymous
Not applicable
4,905 Views
4 Replies
Message 1 of 5

Change RGB colors to Autocad Index Values

Anonymous
Not applicable

Hello all,

I will apologize right away because I know there are other posts similar to this out there, however, I just can't seem to get them to work.  Here is what I am attempting:

I am importing files from another cad system with specific RGB colors.  In the other cad system, I set up specific RGB colors according to the ACI color chart.  I want to convert the RGB colors to the ACI Colors that I intentionally set up.  I then set up a command that would pick these ACI colors, and change the layer properties.  My intent is to be able to have a simple conversion of colors to appropriate layers.  The problem I'm having is that using the different conversion lisp files I've found, they don't seem to match the colors on the ACI color chart.  They'll be off by 2 here and there.  The other issue, I'm not great at setting up lisp files, I can load them, and run them, but there's no debugging done by this guy.  😞  Does anyone have a routine that I can use that will truly convert the RGB colors to specific ACI colors?  I've spent quite a bit of time setting up the colors in the other program only to find that the conversion is close, but not close enough.  Please help!

 

Here are some of the links that I've used...and maybe I've just used them wrong, but I'm not sure what I'm doing wrong.

https://forums.autodesk.com/t5/autocad-2013-2014-2015-2016-2017/autocad-2017-changing-custom-rgb-val...

https://forums.autodesk.com/t5/net/convert-autocad-color-index-to-from-argb/m-p/6420308#M49255

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/routine-to-change-rgb-colors-to-aci-...

 

I apologize in advance for not getting this myself, I've just come to a point where I need my hand held through it!

 

 

 

0 Likes
4,906 Views
4 Replies
Replies (4)
Message 2 of 5

rkmcswain
Mentor
Mentor
brausch wrote:

Does anyone have a routine that I can use that will truly convert the RGB colors to specific ACI colors?

Have you seen this?
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 3 of 5

Anonymous
Not applicable

I think I have, yes...but, apparently, I am simply not smart enough to make it work!  My understanding would be that this is supposed to take the current RGB colors and switch them to the ACI colors.  But, I keep getting the "error" load failed.  Can you provide like exactly the steps I need to make this thing work.  I'm just not getting it!  

 

Thank you!

0 Likes
Message 4 of 5

rkmcswain
Mentor
Mentor
Not sure why you are getting that error.

I just loaded the code (ALL of the code inside the "RGB & ACI" section), and ran the function as shown below and it seems to work fine.

Command: (LM:RGB->ACI 255 200 100)
31

Command: (LM:RGB->ACI 0 233 18)
3

Command: (LM:RGB->ACI 255 0 255)
6



R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 5 of 5

Anonymous
Not applicable

I'm sorry, I was thinking that the file did a search of the entities in the autocad file and converted them to the ACI color.  What you show is that each one needs to be typed in separately.

 

So the next question is:  How do I put the conversion in action to convert all of the colors step by step to ACI without typing each one out at the command line?

0 Likes