简体   繁体   English

如何从使用dxfwrite,Polyline生成的dxf的顶点中删除图层标签

[英]How to remove layer tag from vertex in dxf generated using dxfwrite ,Polyline

I am trying to create dxf exporter. 我正在尝试创建dxf导出器。 I am using dxfwrite in python. 我在python中使用dxfwrite。 When I add vertex it adds some extra fields as layer information automatically. 当我添加顶点时,它会自动添加一些额外的字段作为图层信息。 But I want to remove the layer information from VERTEX in DXF file. 但是我想从DXF文件的VERTEX中删除图层信息。

For example : in python I wrote the following code: 例如:在python中,我编写了以下代码:

from dxfwrite import DXFEngine as dxf 从dxfwrite导入DXFEngine作为dxf

    out = dxf.polyline(linetype='DOT')
    out.add_vertices( [(0,20), (3,20), (6,23), (9,23)] )
    self.drawing.add(out)

It results in following data under POLYLINE Field in dxf file: 它会导致dxf文件中POLYLINE字段下的以下数据:

VERTEX 顶点
8 8
0 0
10 10
0 0
20 20
20 20
30 30
0 0
0 0
VERTEX 顶点
8 8
0 0
10 10
3 3
20 20
20 20
30 30
0 0
0 0
VERTEX 顶点
8 8
0 0
10 10
6 6
20 20
23 23
30 30
0 0
0 0
VERTEX 顶点
8 8
0 0
10 10
9 9
20 20
23 23
30 30
0 0
0 0

But it should be like : 但这应该像:

VERTEX 顶点
10 10
0 0
20 20
20 20
30 30
0 0
0 0
VERTEX 顶点
10 10
3 3
20 20
20 20
30 30
0 0
0 0
VERTEX 顶点
10 10
6 6
20 20
23 23
30 30
0 0
0 0
VERTEX 顶点
10 10
9 9
20 20
23 23
30 30
0 0
0 0

According to the DXF standard the VERTEX entity is a graphical entity, all graphical entities supports a set of common group codes: 根据DXF标准,VERTEX实体是图形实体,所有图形实体都支持一组通用组代码:

From the DXF R12 Reference: 从DXF R12参考中:

Each entity begins with a 0 group identifying the entity type. 每个实体均以0组开头,以标识实体类型。 The names used for the entities are given on the following pages. 在以下页面上提供了用于实体的名称。 Every entity contains an 8 group that gives the name of the layer on which the entity resides. 每个实体都包含一个8组,给出该实体所在层的名称 Each entity may have elevation, thickness, linetype, or color information associated with it. 每个实体可能具有与之关联的高程,厚度,线型或颜色信息。

Therefore the layer tag is mandatory, but applications can also ignores the group code 8, because all vertices should be on the same layer as the POLYLINE entity. 因此,图层标记是必需的,但应用程序也可以忽略组代码8,因为所有顶点都应与POLYLINE实体位于同一层。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM