I tried to merge multiple dxf files into one dxf file.
I've used Importer of ezdxf (Python package) but the result was that dxf files were accumulated in layers on one page.
def merge(source, target):
try:
source = ezdxf.readfile(source)
except ezdxf.DXFError as e:
print("DXF file not found")
return False
try:
importer = Importer(source, target)
importer.import_modelspace()
importer.finalize()
except Exception as e:
print("Error: ", e.__class__)
This is the current output dxf file:
The result I want is continuous dxf files on one page like following:
How can I achieve this?
Thanks for the KJ's comment.
This worked for me and I just need to adjust the translation amount in the y-axis
.
transform.inplace(sdoc.modelspace(), Matrix44.translate(0, index * 0, 0))
Please check this official ezdxf
doc about combining multiple dxf files.
https://ezdxf.readthedocs.io/en/stable/tutorials/xref_module.html#load-modelspace