Hi Gile,
Have not played with autocad stuff for a while now, but recall using in one of my c# routines this:
extern "C" __declspec(dllexport)
void GetRGB (long aciColor, long *Red, long *Green, long *Blue)
{
unsigned long rgb = acedGetRGB(aciColor);
*Red = GetRValue(rgb);
*Green = GetGValue(rgb);
*Blue = GetBValue(rgb);
}
// ARX signature:
//void GetRGB (long aciColor, long *Red, long *Green, long *Blue);
[DllImport(GBPOLY_ARX, CharSet = CharSet.Unicode, EntryPoint = "GetRGB")]
public static extern void getRGB ( int aciColor, out int red, out int green, out int blue );
// color is by index - we need RGB conversion
if (colorHatch.IsByAci)
{
int red = new int();
int green = new int();
int blue = new int();
PInvoke.getRGB((int)colorHatch.ColorIndex, out red, out green, out blue);
Autodesk.AutoCAD.Colors.Color _colorHatch = new Autodesk.AutoCAD.Colors.Color();
_colorHatch = Autodesk.AutoCAD.Colors.Color.FromRgb(Convert.ToByte(red), Convert.ToByte(green), Convert.ToByte(blue));
colorHatch = _colorHatch;
}