我正在尝试使用 python 2.7 和 ezdxf 模块将 DXF 文件的内容绘制到图像中。
我实现了读取和绘制直线、折线、圆,但我不知道如何处理插入元素。我想这个 INSERT 元素(或相关块)包含其他元素,LINE、POLYLINE 等等......对吗?
以下是我访问基础 DXF 元素的方法:
dwg = ezdxf.readfile(filename)
modelspace = dwg.modelspace()
for e in modelspace:
analyseElement(e)
def analyseElement(e):
if e.dxftype() == 'LINE':
print("DXF LINE FOUND:")
p1=e.dxf.start
p2=e.dxf.end
[...]
Run Code Online (Sandbox Code Playgroud)
我可以希望从 INSERT 内容中探索和提取基本元素吗?谢谢你们 !