[FIX] export.lsp: klare Fehlermeldung statt Lisp-Crash bei fehlendem DXFM_LIB

Ist BricsCAD nicht ueber bin/start_briscad.bat gestartet worden, ist DXFM_LIB
in der Sitzung nicht gesetzt. Bisher liess das (strcat (getenv "DXFM_LIB") ...)
mit "bad argument type <NIL> ; expected <STRING>" abstuerzen. Jetzt wird das
vorher geprueft und ueber ssg-textf (exp-dxfm-lib-missing, de/en) gemeldet;
JSON/CSV-Sammlung laeuft weiter, nur der Python-Aufruf entfaellt.
This commit is contained in:
2026-07-31 16:02:33 +02:00
parent df96071f79
commit bd79e3d1b6
3 changed files with 45 additions and 34 deletions
+10 -1
View File
@@ -626,7 +626,14 @@
(close fh) (close fh)
(princ (ssg-textf "exp-json-written" (list label out-pfad))) (princ (ssg-textf "exp-json-written" (list label out-pfad)))
;; Python-Skript aufrufen ;; Python-Skript aufrufen. DXFM_LIB muss gesetzt sein - fehlt es
;; (z.B. weil BricsCAD nicht ueber bin/start_briscad.bat gestartet
;; wurde und die Umgebungsvariablen daher nie in diesen Prozess
;; vererbt wurden), wuerde das folgende strcat sonst mit einem
;; kryptischen Lisp-Fehler ("bad argument type <NIL>") abbrechen.
(if (null (getenv "DXFM_LIB"))
(princ (ssg-textf "exp-dxfm-lib-missing" (list label)))
(progn
(setq py-skript (strcat (getenv "DXFM_LIB") "/" py-name)) (setq py-skript (strcat (getenv "DXFM_LIB") "/" py-name))
(if (findfile py-skript) (if (findfile py-skript)
(progn (progn
@@ -668,6 +675,8 @@
) )
) )
) )
)
)
(princ) (princ)
) )
+1
View File
@@ -499,6 +499,7 @@
"exp-json-written": "\n[%1] JSON geschrieben: %2", "exp-json-written": "\n[%1] JSON geschrieben: %2",
"exp-calling-python": "\n[%1] Rufe Python auf...", "exp-calling-python": "\n[%1] Rufe Python auf...",
"exp-export-started": "\n[%1] Export gestartet: %2", "exp-export-started": "\n[%1] Export gestartet: %2",
"exp-dxfm-lib-missing": "\n[%1] FEHLER: Umgebungsvariable DXFM_LIB ist nicht gesetzt - BricsCAD wurde vermutlich nicht ueber bin/start_briscad.bat gestartet. CSV/JSON wurden geschrieben, der Python-Aufruf entfaellt.",
"exp-python-not-found": "\n[%1] FEHLER: Python-Skript nicht gefunden: %2", "exp-python-not-found": "\n[%1] FEHLER: Python-Skript nicht gefunden: %2",
"exp-python-exe": "\n[%1] Interpreter: %2", "exp-python-exe": "\n[%1] Interpreter: %2",
"exp-export-done": "\n[%1] Export fertig: %2", "exp-export-done": "\n[%1] Export fertig: %2",
+1
View File
@@ -499,6 +499,7 @@
"exp-json-written": "\n[%1] JSON written: %2", "exp-json-written": "\n[%1] JSON written: %2",
"exp-calling-python": "\n[%1] Calling Python...", "exp-calling-python": "\n[%1] Calling Python...",
"exp-export-started": "\n[%1] Export started: %2", "exp-export-started": "\n[%1] Export started: %2",
"exp-dxfm-lib-missing": "\n[%1] ERROR: Environment variable DXFM_LIB is not set - BricsCAD was probably not started via bin/start_briscad.bat. CSV/JSON were written, the Python call is skipped.",
"exp-python-not-found": "\n[%1] ERROR: Python script not found: %2", "exp-python-not-found": "\n[%1] ERROR: Python script not found: %2",
"exp-python-exe": "\n[%1] Interpreter: %2", "exp-python-exe": "\n[%1] Interpreter: %2",
"exp-export-done": "\n[%1] Export finished: %2", "exp-export-done": "\n[%1] Export finished: %2",