Files
kabellaengen/bin/getexdraw.bat
T

65 lines
1.4 KiB
Batchfile

@echo off
if [%1]==[] goto usage
for %%i in ("%~1") do (
set "FILENAME=%%~ni"
set "EXT=%%~xi"
set "DIR=%%~dpi"
)
REM echo Dateiname ohne Erweiterung: %FILENAME%
REM echo Erweiterung: %EXT%
REM echo Verzeichnis: %DIR%
REM
REM Namen der Zwischenergebnis Dateien
set JSON_POS=%FILENAME%_positions.json
set JSON_TODRAW=%FILENAME%_todraw.json
REM Namen der Ergebnisdateien
set ERROR_DOUBLE=%FILENAME%_errors.json
set EXCEL_RES=%FILENAME%_cables.xlsx
set DXF_RES=%FILENAME%_cables.dxf
call C:\10-Develop\gitrepos\kabellaengen\bin\setenv.bat
echo --hole Positionen
call getpositions.bat --filename %1 -s -r -w %JSON_POS% -e %ERROR_DOUBLE%
if exist "%PROJECT_WORK%\%ERROR_DOUBLE%" (
@echo -failed- given items with the same ids
pause
del "%PROJECT_WORK%\%ERROR_DOUBLE%"
goto :eof
)
if not exist "%PROJECT_WORK%\%JSON_POS%" (
@echo -failed- getpositions
pause
goto :eof
)
echo --erzeuge Graph mit Routing
call routing.bat --filename %JSON_POS% -w %JSON_TODRAW%
if not exist "%PROJECT_WORK%\%JSON_TODRAW%" (
@echo -failed- routing
pause
goto :eof
)
echo --zeichne Kabel in dxf Datei
call draw_dxf.bat --filename %JSON_TODRAW% --new %DXF_RES% -x %EXCEL_RES%
if not exist "%PROJECT_WORK%\%EXCEL_RES%" (
@echo -failed- draw_dxf
pause
goto :eof
)
mkdir %INSTALL_DIR%\%FILENAME%
move %PROJECT_WORK%\%FILENAME%_* %INSTALL_DIR%\%FILENAME%
pause
:usage
@echo Usage: %0 ^<dxfinWorkOrdner.dxf^>
exit /B 1
goto :eof