Alle LISP-Module auf ssg-cfg-or umgestellt (hardcodierte Konstanten entfernt)

Alle bisher hart codierten Geometrie-, Farb- und Default-Werte in den
LISP-Modulen werden jetzt ueber ssg-cfg-or aus component_defaults.json
gelesen (mit Fallback auf den bisherigen Wert als Sicherheitsnetz).

Lisp/KreiselInsert.lsp:
  - Geometrie-Konstanten: *kreisel-durchmesser*, *kreisel-pin-abstand*,
    *kreisel-default-laenge*, *kreisel-default-hoehe*, *eckrad-default-hoehe*
  - Beschriftungs-Einstellungen: Texthöhe, Farbe, Abstand
  - Linienfarben (color_linie_1/2, color_pin) fuer Layer/CECOLOR
  - Toleranzen: toleranz_kollinear, toleranz_winkel

Lisp/OmniModulInsert.lsp:
  - Default-Werte fuer HOEHE und DREHUNG beim Einfuegen und Bearbeiten
  - Textgroessen (textHeight, textGap) fuer Vorschau-Dialog
  - Max-Laengen fuer AP60, AP110, APG110

Lisp/VarioFoerderer.lsp:
  - staustrecke-basis, FESTE_HORIZONTAL
  - bogen-winkel Liste (zweifach, in Bibliotheks-Extraktion und Berechnung)
  - gefaelle_winkel (3°) an allen Stellen im Anlagen-Aufbau
  - skalierung_basis fuer Block-Skalierung
  - separator_block_dx/dz, station_block_dx/dz fuer Blockeinfuegung

Lisp/Gefaellestrecke.lsp:
  - Default-Wert fuer deltaL, default_winkel
  - separator_breite fuer Laengenberechnung

Lisp/export.lsp:
  - default_hoehe fuer HOEHE-Attribut-Fallback in Bogen/Weiche/Gerade
  - default_gerade_laenge fuer Laenge-Fallback
  - mm_pro_meter (1000.0) fuer Umrechnung mm->m bei Laengenangaben

Lisp/ssg_dialog.lsp:
  - dialog_preview_bg_color (-18) fuer fill_image Hintergrundfarbe

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 11:26:22 +02:00
parent cc301b318e
commit 9f78ff7f0a
6 changed files with 68 additions and 57 deletions
+24 -13
View File
@@ -35,8 +35,8 @@
(setq aus-dx nil aus-dy nil aus-dz nil)
(setq ein-dx nil ein-dy nil ein-dz nil)
(setq separator-laenge nil umlenk-laenge nil motorstation-laenge nil)
(setq staustrecke-basis 1000)
(setq FESTE_HORIZONTAL 1600)
(setq staustrecke-basis (ssg-cfg-or "vario" "staustrecke_basis" 1000))
(setq FESTE_HORIZONTAL (ssg-cfg-or "vario" "feste_horizontal" 1600))
;; Bogen-Tabellen (werden aus Bibliothek befüllt)
(setq bogen-auf '()) ;; Format: ((winkel dx dy dz) ...)
@@ -400,7 +400,7 @@
(princ "\n Extrahiere Bogen-Masse...")
(setq bogen-auf '())
(setq bogen-ab '())
(setq bogen-winkel '(3 6 9 12 15 18 21 27 33 39 45 51))
(setq bogen-winkel (ssg-cfg-or "vario" "bogen_winkel" '(3 6 9 12 15 18 21 27 33 39 45 51)))
(foreach w bogen-winkel
;; Aufwaertsbogen
@@ -547,7 +547,7 @@
(ensure-block-loaded blockname)
(princ (strcat "\n Fuege '" blockname "' ein (Laenge=" (rtos laenge 2 2) " mm, Winkel=" (itoa winkel) "°)"))
(setq scale (/ laenge 1000.0))
(setq scale (/ laenge (ssg-cfg-or "vario" "skalierung_basis" 1000.0)))
(setq rad (* winkel (/ pi 180.0)))
;; Block am Ursprung einfuegen, damit TransformBy um (0,0,0) rotiert (= Block-Einfuegepunkt)
@@ -647,10 +647,11 @@
(setq abs-dz-AUS (abs aus-dz) abs-dz-EIN (abs ein-dz))
;; ALLE in der Bibliothek verfügbaren Winkel
(setq winkel-list '(3 6 9 12 15 18 21 27 33 39 45 51))
(setq winkel-list (ssg-cfg-or "vario" "bogen_winkel" '(3 6 9 12 15 18 21 27 33 39 45 51)))
(setq ergebnis-liste '())
(setq cos3 (cos (* 3 (/ pi 180.0))) sin3 (sin (* 3 (/ pi 180.0))))
(setq cos3 (cos (* (ssg-cfg-or "vario" "gefaelle_winkel" 3) (/ pi 180.0)))
sin3 (sin (* (ssg-cfg-or "vario" "gefaelle_winkel" 3) (/ pi 180.0))))
(princ "\n\n=========================================\n BERECHNUNG FÜR ALLE WINKEL\n=========================================")
(princ (strcat "\nΔL = " (rtos deltaL 2 2) " mm\nΔH = " (rtos deltaH 2 2) " mm\nRichtung: " richtung))
@@ -773,18 +774,23 @@
(if (> L_GF1 0.1)
(progn
(princ (strcat "\n\n2/11: Gefaellestrecke (3°, Laenge=" (rtos L_GF1 2 2) " mm)"))
(setq aktueller-punkt (insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt L_GF1 3))
(setq aktueller-punkt (insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt L_GF1 (ssg-cfg-or "vario" "gefaelle_winkel" 3)))
)
(princ "\n\n2/11: (uebersprungen)")
)
;; 3. Separator
(princ "\n\n3/11: Separator (300mm, 3° geneigt)")
(setq aktueller-punkt (insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt 3 300 0))
(setq aktueller-punkt (insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
(ssg-cfg-or "vario" "separator_block_dx" 300)
(ssg-cfg-or "vario" "separator_block_dz" 0)))
;; 4. Umlenkstation Block bereits 3° vorgeneigt, keine zusaetzliche Rotation
(princ "\n\n4/11: Umlenkstation (500mm, 3° geneigt)")
(setq aktueller-punkt (insert-rotated-block-with-ks "Vario_Umlenkstation_500mm" aktueller-punkt 0 499 -26))
(setq aktueller-punkt (insert-rotated-block-with-ks "Vario_Umlenkstation_500mm" aktueller-punkt 0
(ssg-cfg-or "vario" "station_block_dx" 499)
(ssg-cfg-or "vario" "station_block_dz" -26)))
;; 5. 1. Vertikalbogen
(if (= richtung "Auf")
@@ -799,7 +805,7 @@
)
(setq bogen-dx (car bogen-mass) bogen-dz (caddr bogen-mass))
(princ (strcat "\n\n5/11: " bogen-name " (3° geneigt)"))
(setq aktueller-punkt (insert-rotated-block-with-ks bogen-name aktueller-punkt 3 bogen-dx bogen-dz))
(setq aktueller-punkt (insert-rotated-block-with-ks bogen-name aktueller-punkt (ssg-cfg-or "vario" "gefaelle_winkel" 3) bogen-dx bogen-dz))
;; 6. Variable Strecke L_VF
(if (> L_VF 0.1)
@@ -835,20 +841,25 @@
;; 8. Motorstation gleiche Behandlung wie Umlenkstation
(princ "\n\n8/11: Motorstation (500mm, 3° geneigt)")
(setq aktueller-punkt (insert-rotated-block-with-ks "Vario_Motorstation_500mm" aktueller-punkt 0 499 -26))
(setq aktueller-punkt (insert-rotated-block-with-ks "Vario_Motorstation_500mm" aktueller-punkt 0
(ssg-cfg-or "vario" "station_block_dx" 499)
(ssg-cfg-or "vario" "station_block_dz" -26)))
;; 9. 2. Gefällestrecke
(if (> L_GF2 0.1)
(progn
(princ (strcat "\n\n9/11: Gefaellestrecke (3°, Laenge=" (rtos L_GF2 2 2) " mm)"))
(setq aktueller-punkt (insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt L_GF2 3))
(setq aktueller-punkt (insert-inclined-scaled-block "Staustrecke_SP_1000_mm" aktueller-punkt L_GF2 (ssg-cfg-or "vario" "gefaelle_winkel" 3)))
)
(princ "\n\n9/11: (uebersprungen)")
)
;; 10. Separator 2
(princ "\n\n10/11: Separator (300mm, 3° geneigt)")
(setq aktueller-punkt (insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt 3 300 0))
(setq aktueller-punkt (insert-rotated-block-with-ks "Staustrecke_Separator_SP_300_mm" aktueller-punkt
(ssg-cfg-or "vario" "gefaelle_winkel" 3)
(ssg-cfg-or "vario" "separator_block_dx" 300)
(ssg-cfg-or "vario" "separator_block_dz" 0)))
;; 11. EIN_Element
(princ (strcat "\n\n11/11: " es-block " (0°)"))