erste Fassung von portalexport.bat dazu. weniger restrikitver Regulärerer Ausdruck für die PFade

This commit is contained in:
2025-07-02 09:40:33 +02:00
parent 6510587453
commit d1f3f4d847
2 changed files with 49 additions and 1 deletions
+48
View File
@@ -0,0 +1,48 @@
@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
call C:\10-Develop\gitrepos\kabellaengen\bin\setenv.bat
echo --hole Positionen
call portalexport.bat --filename %1 -w %JSON_POS% -e %ERROR_DOUBLE%
if exist "%PROJECT_WORK%\%ERROR_DOUBLE%" (
@echo -failed- given items with the same ids
pause
move %PROJECT_WORK%\%ERROR_DOUBLE% %INSTALL_DIR%
goto :eof
)
if not exist "%PROJECT_WORK%\%JSON_POS%" (
@echo -failed- getpositions
pause
goto :eof
)
mkdir %INSTALL_DIR%\%FILENAME%
move %PROJECT_WORK%\%FILENAME%_* %INSTALL_DIR%\%FILENAME%
goto :eof
:usage
@echo Usage: %0 ^<dxfinWorkOrdner.dxf^>
exit /B 1
goto :eof
+1 -1
View File
@@ -205,7 +205,7 @@ def create_mappings(positions:dict) -> tuple:
#print(unterverteiler_pfad)
# Pfad zur Karte splitten. Dieser hat z.B. den Inhalt "=AH01+UH02-KF1FDI7"
pattern = r"^=([A-Z]+\d+)([+\-])([A-Z]+\d+)([+\-])([A-Z0-9]+)$"
pattern = r"^=([A-Z]+\d+)([+\-])([A-Z]+\d+)([+\-])([A-Z]+\d+.)$"
match = re.match(pattern, unterverteiler_pfad)
if match:
anlage = match.group(1)