dxf color

LPlateAndyLPlateAndy Global Mapper UserPosts: 79Trusted User
edited April 2009 in Vector Data
Hi,

Is there a way to maintain the color of a line in Global Mapper in the DXF output?

It's for a fairly basic usage which is generating contours - the brown color would be a nice touch in the dxf, we generate these on the fly with the scripting language.

Thanks...

Andy

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2009
    Andy,

    Lines features exported to DXF should already maintain their basic color. The DXF format has a supported palette of colors and when you export a line to DXF the color for the line is mapped to the nearest DXF color and that is used automatically. Is this not what you are seeing?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited March 2009
    Hi Mike,

    No, i seem to be getting black lines, here's my script after opening the height data and setting the export polygon...

    GENERATE_CONTOURS ELEV_UNITS=METERS INTERVAL=1 GLOBAL_BOUNDS=524950,212450,526050,213550 GEN_SPOT_ELEVATIONS=YES
    UNLOAD_LAYER FILENAME="******"
    EXPORT_VECTOR FILENAME="******.dxf" TYPE=DXF ELEV_UNITS=METERS SPATIAL_RES=10,10 GEN_WORLD_FILE=YES POLYGON_CROP_NAME="******" EXPORT_DXF_LABELS=YES DXF_TEXT_SIZE=8


    Thanks

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2009
    Andy,

    I took a look and it appears that the DXF color palette (at least the colors I know in it) doesn't have anything real close to the brown used by default for contour lines in Global Mapper, so black ends up being the closest color. I would suggest changing the color used for the contour line types in Global Mapper to something perhaps a little redder on the Line Styles tab of the Configuration dialog to get something closer to what you need.

    In case it helps, here is the DXF color palette:

    PenToColorMapEntry_t( 0, RGB( 255, 255, 255 ) ),
    PenToColorMapEntry_t( 1, RGB( 255, 0, 0 ) ),
    PenToColorMapEntry_t( 2, RGB( 255, 255, 0 ) ),
    PenToColorMapEntry_t( 3, RGB( 0, 255, 0 ) ),
    PenToColorMapEntry_t( 4, RGB( 0, 255, 255 ) ),
    PenToColorMapEntry_t( 5, RGB( 0, 0, 255 ) ),
    PenToColorMapEntry_t( 6, RGB( 255, 0, 255 ) ),
    PenToColorMapEntry_t( 7, RGB( 0, 0, 0 ) ),
    PenToColorMapEntry_t( 8, RGB( 128, 128, 128 ) ),
    PenToColorMapEntry_t( 9, RGB( 190, 190, 190 ) ),
    PenToColorMapEntry_t( 11, RGB( 255, 123, 123 ) ),
    PenToColorMapEntry_t( 21, RGB( 255, 156, 123 ) ),
    PenToColorMapEntry_t( 31, RGB( 255, 189, 123 ) ),
    PenToColorMapEntry_t( 41, RGB( 255, 222, 183 ) ),
    PenToColorMapEntry_t( 51, RGB( 255, 255, 123 ) ),
    PenToColorMapEntry_t( 61, RGB( 222, 255, 123 ) ),
    PenToColorMapEntry_t( 71, RGB( 189, 255, 123 ) ),
    PenToColorMapEntry_t( 81, RGB( 156, 255, 123 ) ),
    PenToColorMapEntry_t( 91, RGB( 123, 255, 123 ) ),
    PenToColorMapEntry_t( 101, RGB( 122, 255, 156 ) ),
    PenToColorMapEntry_t( 111, RGB( 123, 255, 189 ) ),
    PenToColorMapEntry_t( 121, RGB( 123, 255, 222 ) ),
    PenToColorMapEntry_t( 131, RGB( 123, 255, 255 ) ),
    PenToColorMapEntry_t( 141, RGB( 123, 222, 255 ) ),
    PenToColorMapEntry_t( 151, RGB( 123, 189, 255 ) ),
    PenToColorMapEntry_t( 161, RGB( 123, 156, 255 ) ),
    PenToColorMapEntry_t( 171, RGB( 123, 123, 255 ) ),
    PenToColorMapEntry_t( 181, RGB( 156, 123, 255 ) ),
    PenToColorMapEntry_t( 191, RGB( 189, 123, 255 ) ),
    PenToColorMapEntry_t( 201, RGB( 222, 123, 255 ) ),
    PenToColorMapEntry_t( 211, RGB( 255, 123, 255 ) ),
    PenToColorMapEntry_t( 221, RGB( 255, 123, 222 ) ),
    PenToColorMapEntry_t( 231, RGB( 255, 123, 189 ) ),
    PenToColorMapEntry_t( 241, RGB( 255, 123, 156 ) ),
    PenToColorMapEntry_t( 251, RGB( 41, 41, 41 ) ),
    PenToColorMapEntry_t( 252, RGB( 90, 90, 90 ) ),
    PenToColorMapEntry_t( 253, RGB( 136, 136, 136 ) ),
    PenToColorMapEntry_t( 254, RGB( 181, 181, 181 ) ),

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited March 2009
    Hi Mike,

    OK - that seems logical.... I'll have a browse through the colours...

    Thanks

    Andy
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited March 2009
    Hi Mike,

    I've found two colors which are bearable but not great. However, i wondered whether there is a way to tweak the DXF output colors?

    I note in particular that color 221 (255, 123, 222) is very close to 211 and 231.

    Contours must be a popular DXF output and worth getting the same color?

    Thanks

    Andy
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited March 2009
    Hi Mike,

    Last comment on the colors...

    It's actually hard to find a matching color in the font option - maroon looked close but that turned black in dxf anyway...

    Thanks

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2009
    Andy,

    The problem with DXF is that internally it uses a palette index to specify the color to use for a feature, but does not have a mechanism for actually storing the palette in the file. Therefore most DXF files use the default palette used by AutoCAD many years ago, which is quite limited in the number of colors. An application could decide to use its own color palette for DXF files, but then no other application would display the data with the same colors as the DXF file doesn't actually define what colors to use.

    I'm actually not surprised that there isn't a good brown. If you remember the original purpose of the DXF format is for CAD drawings, which are typically done on a black background, so brown wouldn't be a commonly used color. It is only recently that DXF files have starting being used for mapping files, even though they are not a good fit for that application.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    Is that AutoCAD R12? We're part of a land survey company and i managed to get as far back as R14 which supports quite a few more colors including a nice orange/brown color which works well on the black or white screen background (our surveyors still use the black background...).

    Pity we can't edit (add) color options and take the risk of unsupported colors ourselves...

    Thanks anyway though

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    If there was anyway that you could find the color palette supported by R14 I could fill those colors in to the palette that I have. I was unable to find the default color palette when I searched online, but I believe you can get it somewhere in AutoCAD itself.

    Another option would be if you could send me a DXF file with features in the other colors, then I could just look in the DXF file and see what color code was used for them.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    Hopefully the following is pretty much spot-on...

    AutoCAD Color Index RGB Equivalents

    Includes the acad color number and RGB equivalents (plus hexidecimal) for all 255 colors

    Thanks again and sorry to pester but this will be fantastic for me and hopefully some others too!

    Cheers

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    Thanks, that table is exactly what I need. It doesn't agree 100% with some of the values that I already have, but that could be error on my part. I'll update Global Mapper with the new table and get you a new build to try.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Cheers Mike,

    You need to be careful, i'm going to run out of things to ask...

    Unparalleled software support as always!

    Much appreciated

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    I have completed updating the DXF color table. I have placed a new build at http://www.globalmapper.com/global_mapper10.zip with the change for you to try. Simply download that file and extract the contents into your existing v10.xx installation folder to give it a try.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    That worked brilliantly - thanks...

    No way of allowing matching numbers of label colours i suppose? (it's always worth asking.....!)

    Thanks again

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    What exactly do you mean by 'matching number of label colours'?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    The label color options seem to be limited to 8 to 10 colors - i don't suppose its possible to allow the same number of colors as the lines?

    Thanks

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    I'm not sure why the standard Windows font selection dialog limits your color selection, but I was able to customize it to allow selection of any color. I have placed a new build at http://www.globalmapper.com/global_mapper10.zip with the change for you to try. Simply download that file and extract the contents into your existing v10.xx installation folder to give it a try.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    Works perfectly now... i guess it was just a very old Windows set of options?

    Hopefully this is actually useful for other people as well...

    Thanks again.

    Andy
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    A bit too quick off the mark there... the label options work brilliantly in GM but on exporting to DXF the color is lost.

    Also, label orientation and positioning (i tried out the option to centre on the contour line) are lost but i'm guessing those are trickier settings to add?

    Thanks

    Andy
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2009
    Andy,

    We are hitting some limitations of the DXF format here. At least as far as I know there is not a separate field for storing text color for text associated with features, like lines. Also for orientation this is supported for text stored as separate text entities (like point features), but not when the text is associated as a label with a particular polyline feature. Global Mapper automatically orients labels along the longest visible segment of a line in the display, so there isn't a single orientation value associated with a line label. Unfortunately most software doesn't do this for line labels and requires an orientation to be explicitly set.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • LPlateAndyLPlateAndy Global Mapper User Posts: 79Trusted User
    edited April 2009
    Hi Mike,

    OK - thanks for all the improvements.

    I'll have a look round for a CAD label color setting - i'd assumed it would actually use the same layer color as the linetype unless explicitly set otherwise....

    Andy
  • rquanrquan Posts: 2
    Andy,

    I took a look and it appears that the DXF color palette (at least the colors I know in it) doesn't have anything real close to the brown used by default for contour lines in Global Mapper, so black ends up being the closest color. I would suggest changing the color used for the contour line types in Global Mapper to something perhaps a little redder on the Line Styles tab of the Configuration dialog to get something closer to what you need.

    In case it helps, here is the DXF color palette:

    PenToColorMapEntry_t( 0, RGB( 255, 255, 255 ) ),
    PenToColorMapEntry_t( 1, RGB( 255, 0, 0 ) ),
    PenToColorMapEntry_t( 2, RGB( 255, 255, 0 ) ),
    PenToColorMapEntry_t( 3, RGB( 0, 255, 0 ) ),
    PenToColorMapEntry_t( 4, RGB( 0, 255, 255 ) ),
    PenToColorMapEntry_t( 5, RGB( 0, 0, 255 ) ),
    PenToColorMapEntry_t( 6, RGB( 255, 0, 255 ) ),
    PenToColorMapEntry_t( 7, RGB( 0, 0, 0 ) ),
    PenToColorMapEntry_t( 8, RGB( 128, 128, 128 ) ),
    PenToColorMapEntry_t( 9, RGB( 190, 190, 190 ) ),
    PenToColorMapEntry_t( 11, RGB( 255, 123, 123 ) ),
    PenToColorMapEntry_t( 21, RGB( 255, 156, 123 ) ),
    PenToColorMapEntry_t( 31, RGB( 255, 189, 123 ) ),
    PenToColorMapEntry_t( 41, RGB( 255, 222, 183 ) ),
    PenToColorMapEntry_t( 51, RGB( 255, 255, 123 ) ),
    PenToColorMapEntry_t( 61, RGB( 222, 255, 123 ) ),
    PenToColorMapEntry_t( 71, RGB( 189, 255, 123 ) ),
    PenToColorMapEntry_t( 81, RGB( 156, 255, 123 ) ),
    PenToColorMapEntry_t( 91, RGB( 123, 255, 123 ) ),
    PenToColorMapEntry_t( 101, RGB( 122, 255, 156 ) ),
    PenToColorMapEntry_t( 111, RGB( 123, 255, 189 ) ),
    PenToColorMapEntry_t( 121, RGB( 123, 255, 222 ) ),
    PenToColorMapEntry_t( 131, RGB( 123, 255, 255 ) ),
    PenToColorMapEntry_t( 141, RGB( 123, 222, 255 ) ),
    PenToColorMapEntry_t( 151, RGB( 123, 189, 255 ) ),
    PenToColorMapEntry_t( 161, RGB( 123, 156, 255 ) ),
    PenToColorMapEntry_t( 171, RGB( 123, 123, 255 ) ),
    PenToColorMapEntry_t( 181, RGB( 156, 123, 255 ) ),
    PenToColorMapEntry_t( 191, RGB( 189, 123, 255 ) ),
    PenToColorMapEntry_t( 201, RGB( 222, 123, 255 ) ),
    PenToColorMapEntry_t( 211, RGB( 255, 123, 255 ) ),
    PenToColorMapEntry_t( 221, RGB( 255, 123, 222 ) ),
    PenToColorMapEntry_t( 231, RGB( 255, 123, 189 ) ),
    PenToColorMapEntry_t( 241, RGB( 255, 123, 156 ) ),
    PenToColorMapEntry_t( 251, RGB( 41, 41, 41 ) ),
    PenToColorMapEntry_t( 252, RGB( 90, 90, 90 ) ),
    PenToColorMapEntry_t( 253, RGB( 136, 136, 136 ) ),
    PenToColorMapEntry_t( 254, RGB( 181, 181, 181 ) ),

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
    Sorry for hijacking the old thread but would like to know if you have the whole DXF color palette. I would really appreciate your help. Thanks.
  • rquanrquan Posts: 2
    The DXF color palette seems to be different than the AutoCAD color as in (http://sub-atomic.com/~moses/acadcolors.html).

Sign In or Register to comment.