call von Test Funktionen dazu in die Menüs. Aufruf einer externen Python Funktion . Rückgabe von Ergebnissen über eine Datei.

This commit is contained in:
2026-05-07 17:53:51 +02:00
parent 4f20325620
commit 9fee0e1eb4
4 changed files with 43 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
;; ============================================================
;; tests.lsp - Test- und Hilfsfunktionen
;; ============================================================
(defun c:CALLPYTHON ( / log-pfad py-skript return-datei cmd fh zeile)
(setq log-pfad (getenv "DXFM_LOG"))
(setq py-skript (strcat (getenv "DXFM_LIB") "\\testpycall.py"))
(setq return-datei (strcat log-pfad "\\testpycall_return.txt"))
(if (findfile py-skript)
(progn
(setq cmd (strcat "python \"" py-skript "\" \"" log-pfad "\""))
(command "_.SHELL" cmd)
(if (findfile return-datei)
(progn
(setq fh (open return-datei "r"))
(setq zeile (read-line fh))
(close fh)
(princ (strcat "\n[SSG_LIB] Python Rueckgabe: " zeile))
)
(princ "\n[SSG_LIB] WARNUNG: Keine Rueckgabe von Python erhalten.")
)
)
(princ (strcat "\n[SSG_LIB] FEHLER: " py-skript " nicht gefunden!"))
)
(princ)
)
(defun c:EXPORTCSV ()
(princ "\n[SSG_LIB] EXPORTCSV: Noch nicht implementiert (Dummy).")
(princ)
)