This commit is contained in:
2026-06-25 15:40:14 +02:00
5 changed files with 103 additions and 20 deletions
+17
View File
@@ -126,6 +126,23 @@
(princ)
)
;; ============================================================
;; SSG_DIM_SWITCH - Umschalten zwischen 2D und 3D Bloecken
;; Setzt DXFM_DIM, DXFM_BLOCKS und DXFM_OMNIFLO neu
;; ============================================================
(defun c:SSG_DIM_SWITCH ( / dim-neu basis)
(setq dim-neu (if (equal (strcase (getenv "DXFM_DIM")) "3D") "2D" "3D"))
(setq basis (getenv "DXFMAKRO"))
(setenv "DXFM_DIM" dim-neu)
(setenv "DXFM_BLOCKS" (strcat basis "\\data\\ils\\" dim-neu))
(setenv "DXFM_OMNIFLO" (strcat basis "\\data\\omniflo\\" dim-neu))
(princ (strcat "\nModus umgeschaltet auf: " dim-neu))
(princ (strcat "\n DXFM_BLOCKS = " (getenv "DXFM_BLOCKS")))
(princ (strcat "\n DXFM_OMNIFLO = " (getenv "DXFM_OMNIFLO")))
(princ)
)
;; ============================================================
;; SSG_BLOCKEDIT - Kontextmenue-Dispatcher
;; Erkennt den selektierten Blocktyp und ruft den passenden
+58 -9
View File
@@ -45,7 +45,53 @@
(setq *modul-cache* nil)
;; ============================================================
;; TEIL 2: BIBLIOTHEK INITIALISIEREN
;; TEIL 2: BLOCK-DATEI-PRUEFUNG
;; ============================================================
;; Prueft ob alle benoetigten Block-Dateien vorhanden sind.
;; Gibt t zurueck wenn OK (oder Library-DXF vorhanden), nil wenn Einzeldateien fehlen.
(defun vf-check-required-blocks ( / lib-datei bogen-winkel required-blocks missing bname datei)
(setq lib-datei
(strcat (vl-string-translate "\\" "/" (getenv "DXFM_DATA"))
"/block_libraries/ils_library.dxf"))
(if (findfile lib-datei)
t ;; Library-Datei vorhanden: alle Bloecke darin verfuegbar
(progn
(setq bogen-winkel (ssg-cfg-or "vario" "bogen_winkel"
'(3 6 9 12 15 18 21 27 33 39 45 51)))
(setq required-blocks
(append
(list "_3D_AS_90_links" "_3D_AS_90_rechts"
"_3D_ES_90_links" "_3D_ES_90_rechts"
"Staustrecke_SP_1000_mm" "Staustrecke_Separator_SP_300_mm"
"Vario_Umlenkstation_500mm" "Vario_Motorstation_500mm")
(mapcar (function (lambda (w) (strcat "Vario_Bogen_auf_" (itoa w) grad-zeichen))) bogen-winkel)
(mapcar (function (lambda (w) (strcat "Vario_Bogen_ab_" (itoa w) grad-zeichen))) bogen-winkel)
)
)
(setq missing '())
(foreach bname required-blocks
(setq datei (strcat block-pfad bname ".dxf"))
(if (not (findfile datei))
(setq missing (cons datei missing))
)
)
(if missing
(progn
(princ (strcat "\n FEHLER: DXFM_BLOCKS = " block-pfad))
(princ "\n Folgende Block-Dateien fehlen:")
(foreach f (reverse missing)
(princ (strcat "\n - " f))
)
nil
)
t
)
)
)
)
;; ============================================================
;; TEIL 3: BIBLIOTHEK INITIALISIEREN
;; ============================================================
(defun init-bibliothek ( / temp-obj bogen-winkel ks-data ks-ein-pos ks-aus-pos
dx dy dz bogen-name)
@@ -54,10 +100,12 @@
(princ "\n Standard-Bibliothek bereits initialisiert.")
t
)
(progn
(setq *lib-initialized* nil)
(setq *ks-cache* nil)
(princ "\n Initialisiere Standard-Bibliothek...")
(if (not (vf-check-required-blocks))
nil
(progn
(setq *lib-initialized* nil)
(setq *ks-cache* nil)
(princ "\n Initialisiere Standard-Bibliothek...")
;; AS_90 Masse extrahieren
(princ "\n Extrahiere AUS_Element Masse...")
@@ -188,8 +236,9 @@
(setq *lib-initialized* t)
(princ "\n Standard-Bibliothek erfolgreich initialisiert.")
t
)
)
) ;; end progn (Initialisierung)
) ;; end (if not vf-check-required-blocks)
) ;; end outer (if and *lib-initialized*)
)
;; ============================================================
@@ -218,9 +267,9 @@
winkel mass1 mass2 gueltig
best-winkel best-L_GF best-L_VF)
(if (not *lib-initialized*)
(if (or (not *lib-initialized*) (null aus-dz) (null ein-dz))
(progn
(alert "Bibliothek nicht initialisiert!")
(princ "\n FEHLER: Bibliothek nicht korrekt initialisiert (AUS/EIN-Masse fehlen)!")
(exit)
)
)