Jump to content

DXF true color


Alisima

Recommended Posts

Hi guys,

 

I'm currently building a pre/post-processing program, including 2D scatter interpolation and a dxf solid export.

 

The problem is, I am unable to find some way to enable truecolor in my dxf export routine. This is the format I use to export a single solid:

 

SOLID

8

Matrix

62

30

10

4523633.318667

20

5721359.383704

11

4523633.318667

21

5721371.475556

12

4523657.660000

22

5721359.383704

13

4523657.660000

23

5721371.475556

0

 

Ok, great, it works, I get a nice image in autocad. But now I like to use truecolors. I have been wrestling with the DXF Reference Guide, which suggest to use the 420 group code, which is indeed how autocad does it. However, when I try the 420 group code, followed by a 24-bit integer color, autocad complains "Undefined group code 420 for object on line 14".

 

When I look further into an autocad generated DXF with an entity that has a truecolor, I notice the solid entity (which has the 420 group code) is linked with a BLOCK_RECORD, which in turn is linked with another BLOCK_RECORD.

 

I have no idea what they do, or how to use them. Autocad complains, again, when I try to insert the 2 BLOCK_RECORD's...

 

So I'm in the dark here.

 

Anyone any idea??

 

Many thanks in advance...

 

Bas.

Link to comment
Share on other sites

  • 4 months later...

Bas,

 

Have you got anywhere with this? I have written a dxf translator program that converts 3D Lidar points + 24 bit true colour data into a dxf file and the points are successfully displayed in AutoCAD. However, the points are always displayed white and not the colour I have assigned to the Group code 420.

 

I shall investigate the BLOCK_RECORD link and get back to you if I have any success but I believe I might try IGES as I have searched high and low for advice on this issue.

 

Cheers,

 

Aubrey

Link to comment
Share on other sites

Aubrey,

 

No man, I'm still using the autocad palette.

 

If you do find out something, please let me know.

 

Many thanks,

 

Cheers, Bas.

Link to comment
Share on other sites

  • 4 years later...

Just in case any one need it,

In 420 group code, a true color with Red==200, Green==100 and Blue==50 is 0x00C86432, and in DXF, in decimal, 13132850

 

Just add two 0's before true color and convert to decimal. Use within AcDbEntity only. This is working fine for me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...