import ezdxf
f = 'Before Modification.dxf'
doc = ezdxf.readfile(f)
msp =doc.modelspace()
for e in msp:
if e.dxftype() in ("DIMENSION", "ARC_DIMENSION", "LARGE_RADIAL_DIMENSION"):
e.dxf.text = '6666'
doc.saveas('Modification After.dxf')
————————————————
Hello,I want to modify DIMENSION’s text,when I open new file in autoCAD,The texts is still Before Modification。
As shown below, only one , at bottom left corner is changed.
my code:
import ezdxf f = 'Before Modification.dxf' doc = ezdxf.readfile(f) msp =doc.modelspace() for e in msp: if e.dxftype() in ("DIMENSION", "ARC_DIMENSION", "LARGE_RADIAL_DIMENSION"): e.dxf.text = '6666' doc.saveas('Modification After.dxf') ———————————————— Hello,I want to modify DIMENSION’s text,when I open new file in autoCAD,The texts is still Before Modification。 As shown below, only one , at bottom left corner is changed.
Modification Before Modification After
files: dxf.zip