DXF/DWG Color Index Mapping Table
If you're reading this post, it's probably because you've determined that DataCAD colors do not equal AutoCAD colors. So when you transfer one way or the other, your drawings do not display or print as you intended. One solution is to load (i.e., use) the DXFDWG.RGB color
palette in any drawing you might export to DXF/
DWG. If you don't want to do that, please read on.
When you export your drawing to DXF/
DWG, DataCAD evaluates the current drawing color
palette and tries to make mathematical matches to AutoCAD's default color
palette. Based on these matches, DataCAD creates a color index mapping table. So DataCAD's White (color index 1) is mapped to AutoCAD's White (color index 7).
Note: (Assuming DEFAULT.RGB is the current color
palette). If DEFAULT.TBL does not exist in the Support Files folder, then DataCAD creates a temporary table in memory. Otherwise, DEFAULT.TBL is used.
When you import (or open) a DXF/
DWG file, DataCAD maps AutoCAD's default colors to best matches in the current drawing color
palette. So AutoCAD's Red (color index 1) is mapped to DataCAD's Red (color index 2).
All is well for White, Red, Green, and Blue. By default, these color indexes round-trip consistently. However, Light Grey (color index 8) becomes color #253 on the way out, and color #253 becomes color #26 on the way in.
So, it's possible for color indexes to get 'scrambled'. To prevent this, you have to make sure the color index mapping from DataCAD to AutoCAD is reversed when mapping from AutoCAD to DataCAD.
Note: If you open DEFAULT.TBL in a text editor you'll notice the values are stored in an INI file format. There are two sections; [Export] and [Import].
All of this occurs automatically if 'Translate colors using color table file' is checked in the 'Import / Export Color Translation' section on the DXF/
DWG tab in Program Preferences. The state of this option is the default 'program' state.
Figure 1 - Option on DXF/DWG tab in Program Preferences
You can override this setting during export by changing the status of 'Translate colors using color table file -> DEFAULT.TBL' on the Export file dialog.
Figure 2 - Option on Export File dialog
The same option is available on the
DWG Import Assignments dialog if 'Interactively assign fonts and line types during import' is enabled in the 'Import Method' section on the DXF/
DWG tab in Program Preferences.
Figure 3 - Option on DXF/DWG tab in Program Preferences
If you select DXF/
DWG Color Map from the Tools pull-down menu, DataCAD will display a dialog with the current drawing color
palette on the left, and AutoCAD's default color
palette on the right. If you select a color on the left, a dot will appear on the right indicating the 'map to' color. If you select a color on the right, you are setting the 'map to' color for the color that is selected on the left (which is not readily apparent).
When you click OK, DataCAD writes out a .TBL file to the Support Files directory using the same name as the currently selected
palette. Typically, this name is DEFAULT.TBL which corresponds to DEFAULT.RGB. If PRIZMA.RGB was the current
palette, then PRIZMA.TBL would be created. So it is possible to use multiple mapping tables, but requires using multiple (or uniquely-named) palettes.
Figure 4 - DXF/DWG Color Index Mapping Table
DataCAD Default Colors
Figure 5 - First 15 DataCAD Colors
White/Black, Red, Green, Blue, Cyan, Magenta, Brown
AutoCAD Default Colors
Figure 6 - First 15 AutoCAD Colors
Red, Yellow, Green, Cyan, Blue, Magenta, White/Black
Default DataCAD Palette
Figure 7 - Default DataCAD Palette (DEFAULT.RGB)
Default AutoCAD Palette
Figure 8 - Default AutoCAD Palette as displayed in R14 and in DataCAD (DXFDWG.RGB)
Default DataCAD to AutoCAD Color Mapping
(First 15 Colors)
(1) White/Black = (7) White/Black
(2) Red = (1) Red
(3) Green = (3) Green
(4) Blue = (5) Blue
(5) Cyan = (134)
(6) Magenta = (214)
(7) Brown = (30)
(8) Light Grey = (253)
(9) Dark Grey = (250)
(10) Light Red = (13)
(11) Light Green = (93)
(12) Light Blue = (173)
(13) Light Cyan = (131)
(14) Light Magenta = (211)
(15) Yellow = (51)
Figure 9 - Illustration of Default DataCAD to AutoCAD Color Mapping
Default AutoCAD to DataCAD Color Mapping
(First 15 Colors)
(1) Red = (2) Red
(2) Yellow = (239)
(3) Green = (3) Green
(4) Cyan = (209)
(5) Blue = (4) Blue
(6) Magenta = (224)
(7) White/Black = (1) White/Black
(8) = (131)
(9) = (28)
(10) = (2) Red
(11) = (10) Light Red
(12) = (43)
(13) = (164)
(14) = (41)
(15) = (162)
Figure 10 - Illustration of Default AutoCAD to DataCAD Color Mapping
Default Color Palette
DataCAD 11 and later versions store the name of the Color
Palette (i.e., RGB) file in the drawing. So the default color
palette is determined by your default drawing. If you create a new, non-default drawing, then DataCAD tries to use the RGB file specified in the [PaletteFile] section of DCADWIN.INI (RGBFile=DEFAULT.RGB).
You can force DataCAD to load a specific color
palette temporarily (the drawing
palette name will be restored when you close the file) by adding the following entry to the [PaletteFile] section of DCADWIN.INI.
Store In Drawing=TRUE
; If FALSE, DataCAD will always read the external (.RGB) color
palette instead of the embedded one.