在带有 ezdxf 库的 python 中,我如何选择 dxf 的所有实体,其中某个参数的值以 0 或 5

问题描述

我想选择高程参数以“0”或“5”结尾的所有实体,将它们放在某个图层中。

import ezdxf
import sys
try:
    doc = ezdxf.readfile("Courbes_Lidar_1m.dxf")
except IOError:
    print(f'Not a DXF file or a generic I/O error.')
    sys.exit(1)
except ezdxf.DXFStructureError:
    print(f'Invalid or corrupted DXF file.')
    sys.exit(2)
print("File opened ----------------------------------------")
CP = doc.layers.new("Main curves")
CP.color = 181
CS = doc.layers.new("Secondary curves")
CS.color = 182
print("Layers created ----------------------------------------")
msp = doc.modelspace()
for x in msp:

print("Get elevation ----------------------------------------")

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)