所以...根据this网页,我创建了一个空的dxf文件并且它有效,但是只要我包含一个MText实体,autocad就会抛出以下错误
GroupTable dictionary was not defined in NamedObject dictionary
Invalid or incomplete DXF input -- drawing discarded.
所以我的问题是:
1-我可以信任该页面并且该页面上的信息是否正确?
2-对象部分需要的最后一个实体是什么?
3-我做错了什么?
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
我复制了除了另一个文件中的句柄之外的所有数字,我应该自己插入所有数字吗?如果是的话,我可以使用最小值或最大值吗? 如果还有其他需要解释的事情请告诉我
答案 0 :(得分:2)
我是ezdxf的作者。
正如错误消息所示,您必须添加名为ACAD_GROUP的根dict条目(ACAD-GROUP错误!),最小对象部分应如下所示:
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
句柄是十六进制值,它们必须在当前DXF文件中是唯一的。标题部分中的$ HANDSEED条目应该比所有使用的句柄都大,但我还没有测试AutoCAD对$ HANDSEED值的严格程度。
将最小的DXF上传到bitbucket: https://bitbucket.org/mozman/ezdxf/downloads/Minimal_DXF_AC1021.dxf
答案 1 :(得分:1)
你提到的页面看起来有点稀疏(但我看起来不长)。 看看官方dxf参考:http://www.autodesk.com/techpubs/autocad/dxf/reference/
从快速扫描中你定义一个字典,其中(应该)包含带有句柄39的对象(字典下面的5-39),然后你结束该部分而不定义对象......