Hi, Is there a conversion function from a RAL number to a RGB color? I need to do that with VBA but cannot find help in AutoCAD help files. Thanks. -- ///// (o)-(o) -----ooO---(_)---Ooo-------------------------- Patrick EMIN www.CADxp.com Le portail francophone CAO et Nouvelles Technologies
Patrick, I know there are premise softwares that perform this function but I need a little more information to give an answer. This is the way I see it: German RAL colors number over 200...correct? For Black: RGB Hex = 00h 00h 00h RGB Dec = 0 0 0 YCbCr = 0 0 0 CMYK = 0 0 0 255 But the closest RAL color that I see is RAL 9003 or Signal Black (Signalweib). The Blabk-white tones have 14 colors?...correct. But no Black??? So the question is...what do you know that can explain how RAL 9003 could equal a variant of RGB(0,0,0)? Good luck, Bob Coward CADS, Inc 800-366-0946
bcoward a écrit : Thanks for answering, what looks to be a more complex problem than I first thought... Of course I looked everywhere on the Internet for information. I found that nice DWF chart done by an australian: http://www.netspace.net.au/~pgodfrey/yerfdog/Color_Books It doesn't seem to be possible to make a unique link between a RAL color code and a RGB color. But my aim is not exactly that, I need to do what AutoCAD is doing when you display the color palettes, I want, by program, give a RAL color, let's say 9010, and I want in return the three RGB values. AutoCAD does it, the only small (big) problem I have is that this conversion function is not exposed as a LISP or VBA function. (may be in ObjectARX?) Thanks for trying to help. -- ///// (o)-(o) -----ooO---(_)---Ooo-------------------------- Patrick EMIN www.CADxp.com Le portail francophone CAO et Nouvelles Technologies
Patrick, No problem. I found it to be a very interesting question. Most of my information was derived from www.proav.de/data/color.html Good luck, Bob Coward CADS, Inc 800-366-0946
Try this code. Sub test() Dim col As New AutoCAD.AcadAcCmColor col.SetColorBookColor "RAL CLASSIC", "RAL 1002" Debug.Print col.Red & "," & col.Green & "," & col.Blue 'This should print values 210,183,115 End Sub