Prints in getexdraw.bat und in drawdxf.py leicht angepasst
This commit is contained in:
+9
-6
@@ -22,11 +22,11 @@ set DXF_RES=%FILENAME%_cables.dxf
|
|||||||
|
|
||||||
call C:\10-Develop\gitrepos\kabellaengen\bin\setenv.bat
|
call C:\10-Develop\gitrepos\kabellaengen\bin\setenv.bat
|
||||||
|
|
||||||
|
echo.
|
||||||
echo --hole Positionen
|
echo === Fetching Positions ===
|
||||||
call getpositions.bat --filename %1 -s -r -w %JSON_POS% -e %ERROR_DOUBLE%
|
call getpositions.bat --filename %1 -s -r -w %JSON_POS% -e %ERROR_DOUBLE%
|
||||||
if exist "%PROJECT_WORK%\%ERROR_DOUBLE%" (
|
if exist "%PROJECT_WORK%\%ERROR_DOUBLE%" (
|
||||||
@echo -failed- given items with the same ids
|
@echo -failed- duplicate IDs in given layout
|
||||||
pause
|
pause
|
||||||
move %PROJECT_WORK%\%ERROR_DOUBLE% %INSTALL_DIR%
|
move %PROJECT_WORK%\%ERROR_DOUBLE% %INSTALL_DIR%
|
||||||
goto :eof
|
goto :eof
|
||||||
@@ -36,20 +36,23 @@ if not exist "%PROJECT_WORK%\%JSON_POS%" (
|
|||||||
pause
|
pause
|
||||||
goto :eof
|
goto :eof
|
||||||
)
|
)
|
||||||
echo --erzeuge Graph mit Routing
|
echo.
|
||||||
|
echo === Creating Graph for Routing ===
|
||||||
call routing.bat --filename %JSON_POS% -w %JSON_TODRAW%
|
call routing.bat --filename %JSON_POS% -w %JSON_TODRAW%
|
||||||
if not exist "%PROJECT_WORK%\%JSON_TODRAW%" (
|
if not exist "%PROJECT_WORK%\%JSON_TODRAW%" (
|
||||||
@echo -failed- routing
|
@echo -failed- routing
|
||||||
pause
|
pause
|
||||||
goto :eof
|
goto :eof
|
||||||
)
|
)
|
||||||
echo --zeichne Kabel in dxf Datei
|
echo.
|
||||||
call draw_dxf.bat --filename %JSON_TODRAW% --new %DXF_RES% -x %EXCEL_RES%
|
echo === Writing Output Files ===
|
||||||
|
call draw_dxf.bat --filename %JSON_TODRAW% --new %DXF_RES% -x %EXCEL_RES% -l
|
||||||
if not exist "%PROJECT_WORK%\%EXCEL_RES%" (
|
if not exist "%PROJECT_WORK%\%EXCEL_RES%" (
|
||||||
@echo -failed- draw_dxf
|
@echo -failed- draw_dxf
|
||||||
pause
|
pause
|
||||||
goto :eof
|
goto :eof
|
||||||
)
|
)
|
||||||
|
echo.
|
||||||
|
|
||||||
mkdir %INSTALL_DIR%\%FILENAME%
|
mkdir %INSTALL_DIR%\%FILENAME%
|
||||||
move %PROJECT_WORK%\%FILENAME%_* %INSTALL_DIR%\%FILENAME%
|
move %PROJECT_WORK%\%FILENAME%_* %INSTALL_DIR%\%FILENAME%
|
||||||
|
|||||||
+3
-5
@@ -77,8 +77,6 @@ def add_polyline(msp, points:Polyline, dxf_attribs):
|
|||||||
def new_dxf(plines, out_path):
|
def new_dxf(plines, out_path):
|
||||||
""" creates a new dxf file with a polyline inside which is created by the given json file
|
""" creates a new dxf file with a polyline inside which is created by the given json file
|
||||||
"""
|
"""
|
||||||
print("creating new .dxf ..")
|
|
||||||
|
|
||||||
doc = ezdxf.new('R2018', setup=True)
|
doc = ezdxf.new('R2018', setup=True)
|
||||||
draw_cables(plines, doc)
|
draw_cables(plines, doc)
|
||||||
draw_sensors(plines, doc)
|
draw_sensors(plines, doc)
|
||||||
@@ -86,7 +84,7 @@ def new_dxf(plines, out_path):
|
|||||||
draw_racks(plines, doc)
|
draw_racks(plines, doc)
|
||||||
|
|
||||||
doc.saveas(out_path)
|
doc.saveas(out_path)
|
||||||
print("done")
|
print("Cable-Routes exported to new dxf-file")
|
||||||
|
|
||||||
def modify_original_dxf(plines, originaldxf):
|
def modify_original_dxf(plines, originaldxf):
|
||||||
""" adds new layer to original .dxf-file that contains cables
|
""" adds new layer to original .dxf-file that contains cables
|
||||||
@@ -371,7 +369,7 @@ def write_excel_from_json(plines: Polylines, sens2cable: dict, outpath: str, wit
|
|||||||
_create_error_sheets(wb_main, plines)
|
_create_error_sheets(wb_main, plines)
|
||||||
|
|
||||||
wb_main.save(outpath)
|
wb_main.save(outpath)
|
||||||
print("Cable-Summary exported to Excel file")
|
print("Cable-Summary exported to Excel-file")
|
||||||
|
|
||||||
# 3. Optionale Stücklisten-Datei (BOM) erstellen
|
# 3. Optionale Stücklisten-Datei (BOM) erstellen
|
||||||
if with_bom:
|
if with_bom:
|
||||||
@@ -600,7 +598,7 @@ def _create_bom_workbook(outpath, processed_data, bezeichner_cfg):
|
|||||||
|
|
||||||
bom_path = outpath.replace("_cables.xlsx", "_BOM.xlsx")
|
bom_path = outpath.replace("_cables.xlsx", "_BOM.xlsx")
|
||||||
wb.save(bom_path)
|
wb.save(bom_path)
|
||||||
print(f"BOM saved as an excel file")
|
print(f"BOM exported to Excel-file")
|
||||||
|
|
||||||
def check_file_in_work(work_dir, filename):
|
def check_file_in_work(work_dir, filename):
|
||||||
fexists = True
|
fexists = True
|
||||||
|
|||||||
Reference in New Issue
Block a user