diff --git a/Lisp/KreiselInsert.lsp b/Lisp/KreiselInsert.lsp index 9214faa..417a814 100644 --- a/Lisp/KreiselInsert.lsp +++ b/Lisp/KreiselInsert.lsp @@ -4,37 +4,25 @@ ;; ============================================ ;; ============================================================ -;; TEIL 1: GLOBALE EINSTELLUNGEN (Einfach, aber sicher) +;; TEIL 1: GLOBALE EINSTELLUNGEN ;; ============================================================ -(if (getenv "DXFM_BLOCKS") - (setq modul-pfad (strcat (getenv "DXFM_BLOCKS") "/")) - (progn - (alert "Umgebungsvariable DXFM_BLOCKS nicht gesetzt!\nBitte zuerst bin\\setenv.bat ausfuehren.") - (exit) - ) +(setq block-pfad (getenv "DXFM_BLOCKS")) +(if (or (null block-pfad) (= block-pfad "")) (progn - (alert - "DXFM_BLOCKS nicht gesetzt!\n\n" - "Bitte fuehren Sie zuerst bin\\setenv.bat aus,\n" - "oder setzen Sie den Pfad manuell mit:\n" - "(setenv \"DXFM_BLOCKS\" \"C:/Users/y.wang/Documents/dxfmakros/Blocks/")" - ) - (exit) + (setq block-pfad "C:/Users/y.wang/Documents/dxfmakros/Blocks/") ;; Fallback oder manuell + (alert (strcat "Umgebungsvariable DXFM_BLOCKS nicht gefunden.\nNutze Standardpfad: " block-pfad)) ) + (setq block-pfad (strcat (vl-string-right-trim "/" (vl-string-translate "\\" "/" block-pfad)) "/")) ) -;; block-pfad neu setzen -(setq *block-path* (getenv "DXFM_BLOCKS")) -(princ (strcat "\n✅ Block-Pfad: " block-pfad)) - -;; Basispunkt: Linker Kreis, linkester Tangentenpunkt (links Mitte) -;; ============================================ +(setq *block-path* block-pfad) +(princ (strcat "\n✅ Block-Pfad aktiv: " block-pfad)) ;; Standardwerte initialisieren -(setq #Kreisel_Abstand 2300.0) -(setq #Kreisel_Typ "PIN") +(if (null #Kreisel_Abstand) (setq #Kreisel_Abstand 2300.0)) +(if (null #Kreisel_Typ) (setq #Kreisel_Typ "PIN"))