Reputation: 539
So... according to this web page I created an empty dxf file and it worked, but as soon as I included a MText entity, autocad throws the following error
GroupTable dictionary was not defined in NamedObject dictionary
Invalid or incomplete DXF input -- drawing discarded.
So my questions are :
1- Can I trust that page and are the information on that page correct?
2- What is the last entity required in the object section?
3- What am I doing wrong?
0
SECTION
2
HEADER
9
$ACADVER
1
AC1024
9
$HANDSEED
5
FFF
0
ENDSEC
0
SECTION
2
CLASSES
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
VPORT
5
1
330
0
100
AcDbSymbolTable
70
1
0
VPORT
5
2
330
8
100
AcDbSymbolTableRecord
100
AcDbViewportTableRecord
2
*Active
70
0
10
0.0
20
0.0
11
1.0
21
1.0
12
0.9778937033030414
22
-0.0911774291574901
13
0.0
23
0.0
14
0.5
24
0.5
15
0.5
25
0.5
16
0.0
26
0.0
36
1.0
17
0.0
27
0.0
37
0.0
40
1.97341154280437
41
2.161781285231116
42
50.0
43
0.0
44
0.0
50
0.0
51
0.0
71
0
72
1000
73
1
74
3
75
0
76
0
77
0
78
0
281
0
65
1
110
0.0
120
0.0
130
0.0
111
1.0
121
0.0
131
0.0
112
0.0
122
1.0
132
0.0
79
0
146
0.0
348
2F
60
3
61
5
292
1
282
1
141
0.0
142
0.0
63
250
421
3355443
1001
ACAD_NAV_VCDISPLAY
1070
1
0
ENDTAB
0
TABLE
2
LTYPE
5
3
330
0
100
AcDbSymbolTable
70
3
0
LTYPE
5
4
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ByBlock
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
5
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
ByLayer
70
0
3
72
65
73
0
40
0.0
0
LTYPE
5
6
330
5
100
AcDbSymbolTableRecord
100
AcDbLinetypeTableRecord
2
Continuous
70
0
3
Solid line
72
65
73
0
40
0.0
0
ENDTAB
0
TABLE
2
LAYER
5
7
330
0
100
AcDbSymbolTable
70
1
0
LAYER
5
8
330
2
100
AcDbSymbolTableRecord
100
AcDbLayerTableRecord
2
0
70
0
62
7
6
Continuous
370
-3
390
F
347
21
0
ENDTAB
0
TABLE
2
STYLE
5
9
330
0
100
AcDbSymbolTable
70
2
0
STYLE
5
A
330
3
100
AcDbSymbolTableRecord
100
AcDbTextStyleTableRecord
2
Standard
70
0
40
0.0
41
1.0
50
0.0
71
0
42
0.2
3
txt
4
0
ENDTAB
0
TABLE
2
VIEW
5
B
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
UCS
5
C
330
0
100
AcDbSymbolTable
70
0
0
ENDTAB
0
TABLE
2
APPID
5
D
330
0
100
AcDbSymbolTable
70
5
0
APPID
5
E
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD
70
0
0
APPID
5
F
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
AcadAnnotative
70
0
0
APPID
5
10
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD_NAV_VCDISPLAY
70
0
0
APPID
5
11
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD_EXEMPT_FROM_CAD_STANDARDS
70
0
0
APPID
5
12
330
9
100
AcDbSymbolTableRecord
100
AcDbRegAppTableRecord
2
ACAD_MLEADERVER
70
0
0
ENDTAB
0
TABLE
2
DIMSTYLE
5
13
330
0
100
AcDbSymbolTable
70
2
100
AcDbDimStyleTable
71
0
0
DIMSTYLE
105
14
330
A
100
AcDbSymbolTableRecord
100
AcDbDimStyleTableRecord
2
Standard
70
0
340
55
0
ENDTAB
0
TABLE
2
BLOCK_RECORD
5
15
330
0
100
AcDbSymbolTable
70
1
0
BLOCK_RECORD
5
16
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Model_Space
340
74
70
0
280
1
281
0
0
BLOCK_RECORD
5
17
330
1
100
AcDbSymbolTableRecord
100
AcDbBlockTableRecord
2
*Paper_Space
340
70
70
0
280
1
281
0
0
ENDTAB
0
ENDSEC
0
SECTION
2
BLOCKS
0
BLOCK
5
1B
330
71
100
AcDbEntity
8
0
100
AcDbBlockBegin
2
*Model_Space
70
0
10
0.0
20
0.0
30
0.0
3
*Model_Space
1
0
ENDBLK
5
1C
330
71
100
AcDbEntity
8
0
100
AcDbBlockEnd
0
BLOCK
5
1D
330
6D
100
AcDbEntity
67
1
8
0
100
AcDbBlockBegin
2
*Paper_Space
70
0
10
0.0
20
0.0
30
0.0
3
*Paper_Space
1
0
ENDBLK
5
1E
330
6D
100
AcDbEntity
67
1
8
0
100
AcDbBlockEnd
0
ENDSEC
0
SECTION
2
ENTITIES
0
MTEXT
5
18
100
AcDbEntity
8
0
100
AcDbMText
10
2.73902
20
2.480626
30
0.0
40
0.2
41
5.0
71
1
72
5
1
{\fArial|b0|i0|c178|p34;\U+FE90\U+FEB4\U+FB7C\U+FEAE\U+FE91}
73
1
44
1.0
0
MTEXT
5
19
100
AcDbEntity
8
0
100
AcDbMText
10
-3.37209
20
2.054275
30
0.0
40
0.2
41
5.0
71
1
72
5
1
{\fArial|b0|i0|c178|p34;\U+FE90\U+FEB4\U+FB7C\U+FEAE\U+FE91}
73
1
44
1.0
0
MTEXT
5
1A
100
AcDbEntity
8
0
100
AcDbMText
10
0
20
0
30
0.0
40
0.2
41
5.0
71
1
72
5
1
{\fArial|b0|i0|c178|p34;\U+FE90\U+FEB4\U+FB7C\U+FEAE\U+FE91}
73
1
44
1.0
0
ENDSEC
0
SECTION
2
OBJECTS
0
DICTIONARY
5
1F
330
0
100
AcDbDictionary
3
ACAD_GROUP
350
20
0
DICTIONARY
5
20
102
{
ACAD_REACTORS
330
C
102
}
330
C
100
AcDbDictionary
0
ENDSEC
0
EOF
I copied all of the numbers except for the handles from another file, should I insert all the numbers myself? if so, is there a minimum or maximum I can use?
if there is any thing else that needs explaining please let me know
Upvotes: 1
Views: 1078
Reputation: 2239
I am the author of ezdxf.
As the error message says, you have to add a root dict entry called ACAD_GROUP (ACAD-GROUP is wrong!), the minimal objects section should look like this:
0
SECTION
2
OBJECTS
0
DICTIONARY
5
C
330
0
100
AcDbDictionary
281
1
3
ACAD_GROUP
350
D
0
DICTIONARY
5
D
330
C
100
AcDbDictionary
281
1
0
ENDSEC
Handles are Hex-Values and they have to be unique in the current DXF file. The $HANDSEED entry in the header section should be bigger than every used handle, but i have not tested how strict AutoCAD is about the $HANDSEED value.
Uploaded a minimal DXF to bitbucket: https://bitbucket.org/mozman/ezdxf/downloads/Minimal_DXF_AC1021.dxf
Upvotes: 4
Reputation: 526
The page you mentioned seems a bit sparse (but I did not look long). Have a look at the official dxf Reference: http://www.autodesk.com/techpubs/autocad/dxf/reference/
From a quick scan you are defining a dictionary with (should) contain en object with handle 39 (5-39 just under dictionary), Then you end the section without defining the object...
Upvotes: 1