Problem with very simple DXF

Mar 16 at 8:34 PM
Hello,
I am trying to use very simple DXF files. The files have no version information and just contain basic information (see below). When I try to read the file, the library reads beyond the end of the file expecting more information. I have set the fileversion manually to Autocad 2000. Is there a somewhat simple way to make the library work with those DXF files.

Thanks Alex!

Here is a sample DXF:

0
SECTION
2
HEADER
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
70
1
0
LTYPE
2
CONTINUOUS
70
0
3
Solid line
72
65
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
LAYER
2
OUTLINE
70
0
62
1
6
CONTINUOUS
0
LAYER
2
VBore
70
0
62
2
6
CONTINUOUS
0
LAYER
2
HBore
70
0
62
3
6
CONTINUOUS
0
LAYER
2
LineBore
70
0
62
4
6
CONTINUOUS
0
LAYER
2
Groove
70
0
62
5
6
CONTINUOUS
0
LAYER
2
ToolPath
70
0
62
6
6
CONTINUOUS
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
POLYLINE
8
Outline
66
1
10
0.0
20
0.0
30
0.0
39
19.05
70
1
0
VERTEX
8
Outline
10
412.75
20
0
30
0.0
0
VERTEX
8
Outline
10
412.75
20
584.25
30
0.0
0
VERTEX
8
Outline
10
0
20
584.25
30
0.0
0
VERTEX
8
Outline
10
0
20
0
30
0.0
0
SEQEND
0
TEXT
8
PartNames
10
206.375
20
584.25
30
0.0
40
0
41
1
1
Adjustable Shelf
0
TEXT
8
PartDims
10
206.375
20
0
30
0.0
40
0
41
1
1
41.3
0
TEXT
8
PartDims
10
0
20
292.125
30
0.0
40
0
41
1
50
-90
1
58.4
0
ENDSEC
0
EOF
Mar 17 at 7:23 AM
Tried to view it with Autodesk A360 Viewer and got this error message

Sorry, the drawing file is invalid and cannot be viewed. - Please try to recover the file in AutoCAD, and upload it again to view.

So there is an error in your dxf file.
Mar 17 at 9:35 AM
What I can see, running the debugger, your file is missing AcDbSymbolTableRecord.
while reading a table there is this code
 while (this.chunk.ReadString() != DxfObjectCode.EndTable)
            {
                // table entry common codes
                while (this.chunk.Code != 100)
Which means that if you don't have the AcDbSymbolTableRecord in your table then this loop will read until the end of the file and then "crash".

the spec from Autodesk says
100 Subclass marker (AcDbSymbolTableRecord)

I don't know enough about DXF to tell you why and where this is needed.But a "simple" solution is to use DraftSight and open the dxf and then save it as a AutoCad 2000 dxf. DraftSight will supply the necessary "tags" and then NetDxf will run...
Coordinator
Mar 18 at 4:36 PM
The excerpt of the dxf file you are showing corresponds to the old v12 dxf structure. neDxf supports dxf versions 2000 and upwards. It is not as straightforward as manually changing the version to make it work.

Daniel