英文:
Issue to duplicate Ellipse-Arc inside DXF file
问题
以下是您要翻译的内容:
我正在尝试编写一段代码,以DXF文件格式生成椭圆/弧线。椭圆的数量取决于一些参数。对于生成一个或两个椭圆,我没有问题。但是当椭圆的数量增加时,最终文件会损坏。
我发现椭圆的名称应遵循一种我不确定AutoCAD正在使用的命名规则。
我从AutoCAD生成的椭圆中提取了这些名称
D1, D3, 87, 92, 98, 9E, A4, AA, B0m B6, BC, C2, C3, C9, CF, D5, D7, D9
我的问题是AutoCAD使用什么系统/规则来进行命名?
如果您注意到AutoCAD在第一个椭圆中使用了D1,然后使用D3。
英文:
I am trying to write a code to generate ellipse/arc using DXF file format. The number of ellipses depend on some parameters. I don't have issue to generate one ellipse or two. But when the number of ellipses increase, eventually the file gets corrupted.
I found out it's the name of the ellipse should follow a rule in naming which I am not sure what system autoCAD is using for the naming.
I extracted these names from the ellipes which were gernerated by autoCAD
D1, D3, 87, 92, 98, 9E, A4, AA, B0m B6, BC, C2, C3, C9, CF, D5, D7, D9
my question is what system/rule does autoCAD use for the naming?
If you notice that autoCAD uses D1 in the first ellipse, and then D3
0
ELLIPSE
5
D1
330
70
100
AcDbEntity
8
0
100
AcDbEllipse
10
8.193371416945673
20
6.584439091463058
30
0.0
11
0.0
21
0.9445114593901811
31
0.0
210
0.0
220
0.0
230
1.0
40
0.9770115006281081
41
3.141592653589792
42
4.712388980384688
0
ELLIPSE
5
D3
330
70
100
AcDbEntity
8
0
100
AcDbEllipse
10
8.193371416945673
20
6.584439091463058
30
0.0
11
0.0
21
0.9445114593901811
31
0.0
210
0.0
220
0.0
230
1.0
40
0.9770115006281081
41
3.141592653589792
42
4.712388980384688
答案1
得分: 0
组代码5(标签<5,D3>)定义了一个实体句柄(文本字符串,最多包含16个十六进制数字),并且必须对DXF文件中的每个实体唯一。因此,您需要跟踪DXF文件中使用的所有句柄(STYLE实体使用组代码105表示句柄,是唯一的例外)。
AutoCAD会在将下一个可用句柄写入HEADER变量$HANDSEED时感到满意,但不需要有效条目来打开DXF文件。
另请参阅:由Autodesk提供的DXF参考。
英文:
Group code 5 (tag <5, D3>)defines an entity handle (text string with up to 16 hexadecimal digits) and must be unique for each entity in the DXF file. So you need to keep track of all the handles used in your DXF file (the STYLE entity uses group code 105 for the handle and is the only exception).
AutoCAD is happy when you write the next available handle to the HEADER variable $HANDSEED, but does not require a valid entry to open the DXF file.
See also: DXF Reference provided by Autodesk
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论