diff --git a/bin/svg2dxf.bat b/bin/svg2dxf.bat index a8ba4c8..1ff866e 100644 --- a/bin/svg2dxf.bat +++ b/bin/svg2dxf.bat @@ -1,10 +1,7 @@ @echo off -REM ~dp0 steht für das Verzeichnis, in der diese Datei liegt - -call setenv.bat - REM Beispielaufruf mit Parametern: REM --in: Ordner mit .svg bzw. .xml-Dateien (optional. Standard: data/svg) REM --out: Zielverzeichnis (optional. Standard: work/converted_dxfs) - -python %PROJECT_LIB%\svg2dxf.py %* \ No newline at end of file +CALL manage_interpreter.bat activate_interpreter +python %PROJECT_LIB%\svg2dxf.py %* +CALL manage_interpreter.bat deactivate_interpreter \ No newline at end of file diff --git a/lib/plant2dxf.py b/lib/plant2dxf.py index d0b095a..b582829 100644 --- a/lib/plant2dxf.py +++ b/lib/plant2dxf.py @@ -323,7 +323,12 @@ def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols) print(f"[WARN] Omniflo-Block '{blockname}' nicht in Bibliothek {lib_doc.filename}. Überspringe {teileid}.") return import_block(blockname, lib_doc, doc) + lib_block = lib_doc.blocks.get(blockname) + imported_block = doc.blocks.get(blockname) + if hasattr(lib_block.block.dxf, "base_point"): + imported_block.block.dxf.base_point = lib_block.block.dxf.base_point if merkmale.get("Drehung")== 0: + bref = msp.add_blockref(blockname, (x, y), dxfattribs={"xscale": 1.0, "yscale":1.0,"rotation": merkmale.get("Drehung")}) else: @@ -365,6 +370,7 @@ def main(csv_path: Path, lib_path: Path, cfg_path: Path, # Neue Ziel­zeichnung (DXF R2018) doc = ezdxf.new(dxfversion="R2018") + doc.header['$INSUNITS'] = 4 # Millimeter msp = doc.modelspace() # Höhe bestimmen für Koordinaten-Transformation diff --git a/lib/requirements.txt b/lib/requirements.txt index 9cdb0fe..2902cfd 100644 --- a/lib/requirements.txt +++ b/lib/requirements.txt @@ -1 +1,2 @@ ezdxf==1.4.1 +svg.path==7.0 \ No newline at end of file