Python DXF merger solution. Just a function wrap based on ezdxf to merge n dxf files into a unique new dxf file. This solution merge each content from source dxf into a new layer on target dxf.
-
Python 3.7+
-
Virtualenv
-
ezdxf (https://github.com/mozman/ezdxf)
Code formatter used: black (https://github.com/psf/black)
Basically it uses ezdxf's add-on Importer to merge any dxf into an empty shell.
You can edit data.json file to change input folder+files, output folder+file:
{
"desc": "files for a demo dxf merger based on ezdxf",
"pathin": "in/",
"pathout": "out/",
"targetfile": "merge.dxf",
"use_filelist": true,
"filelist": ["manzana.dxf", "parcela.dxf", "tejido.dxf"],
}
You can get more info at https://ezdxf.readthedocs.io/en/stable/addons/importer.html
-
unit test transformation.
-
maybe transform script into Class so i think ll be easier to reuse / include into a data pipeline.
-
Added layers, each new dxf data is imported into a new independent layer.