File: DXF%20binary%20chunk%20interpretation.md

package info (click to toggle)
ezdxf 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 46,952 kB
  • sloc: python: 158,141; javascript: 166; cpp: 138; makefile: 116; lisp: 20
file content (64 lines) | stat: -rw-r--r-- 2,825 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
DXF file’s Binary chunk interpretation
--------------------------------------

by Fenton Webb
http://adndevblog.typepad.com/autocad/2013/02/dxf-files-binary-chunk-interpretation.html

Issue

I need to know how to interpret the binary data enclosed in AutoCAD DXF
files, most importantly:

- the block preview bitmap,
- the drawing thumbnail bitmap,
- any embedded OLE object,
- the proxy object graphics.

Solution

Binary Data enclosed in DXF file are stored by blocks of 256 bytes maximum under
DXF code 310 (i.e. 'kDxfBinaryChunk'). The number of blocks is not limited, but
sometimes the binary chunk blocks are preceded by a DXF code 92 (of type int)
which indicates the number of blocks to proceed. All binary chunk formats depend
on the object being saved. For example the drawing thumbnail bitmap is a DIB
file. For the embedded OLE object, it depends on the OLE object itself, etc.

- ACIS: the binary chunk blocks contain the encrypted DXF output of the ACIS
object. There is a utility available at the following URL, which can help to
decode that block(s)

http://autocad.xarch.at/stdlib/html/samp5v51.htm

- Block preview image bitmap and Drawing thumbnail bitmap: the binary chunk
blocks are a memory copy of a BITMAPINFO structure, with bitmap bits.

- Embedded OLE object: it depends on the OLE Item version
- For OLE1:
- it is a memory copy of MFC COleClientItem object version OLE1
- For OLE2:
- Signature: 0x5580 | kPaperSpace (kPaperSpace = 0x01)
- AcGePoint3d() upLeft
- AcGePoint3d() upRight
- AcGePoint3d() bottomRight
- AcGePoint3d() bottomLeft
- long extents =0 // always
- long tilemode (=0, or =1) (r13 compatibility)
- then the output of COleclientItem::Serialize() method

- DXF ENTITY section binary chunk interpretation: sometimes the ENTITY section
of an object contains some binary chunk information block(s). This section
appears for any object which is not part of the AutoCAD core (i.e. custom
entities, or AutoCAD entities defined in ARX/DBX modules). It is always preceded
by a DXF code 92 which indicates the length of the binary chunk. And the binary
chunk contains the proxy graphic generated by the entity, when its 'saveAs()'
method was called by AutoCAD. Depending of the settings of AutoCAD (i.e. Proxy
Graphic Never Saved), and the presence of the ARX/DBX module when the DXFOUT
operation occurred, the binary chunk can contain:
- a bounding box with class name and logical application name,
- the last known entity graphic description.

- Proxy graphics binary chunk: this one contains the output of the
AcGiWorldDraw/AcGiViewportDraw vector collector classes which were called upon
DXFOUT. You need to interpret those information to rebuild the saved graphic...
Proxy graphic in dxf binary chunk interpretation describes
how to interpret information contained in these blocks.