This commit is contained in:
2026-06-30 10:03:49 +02:00
4 changed files with 76 additions and 75 deletions
+27 -25
View File
@@ -27,6 +27,7 @@
;; ============================================================
(if (null grad-zeichen) (setq grad-zeichen (chr 176)))
(if (null delta-sym) (setq delta-sym (chr 916)))
(if (null *gf-ks-cache*) (setq *gf-ks-cache* nil))
(if (null *gf-lib-geladen*)(setq *gf-lib-geladen* nil))
@@ -49,10 +50,11 @@
;; Laufende GF-Blocknummer (sitzungspersistent)
(if (null #GF_LetzteNr) (setq #GF_LetzteNr 0))
;; DXFM_DIM sicher lesen (type-Guard gegen nicht-String Rueckgabewerte)
;; DXFM_DIM lesen; 2D wird auf 3D korrigiert (Gefaellestrecke benoetigt Z-Geometrie)
(setq *gf-dxfm-dim* (getenv "DXFM_DIM"))
(if (not (= (type *gf-dxfm-dim*) 'STR)) (setq *gf-dxfm-dim* "3D"))
;; Block-Pfad: primaer aus DXFMAKRO + DXFM_DIM, dann *ssg-lisp-pfad*-Heuristik
(if (or (not (= (type *gf-dxfm-dim*) 'STR)) (= *gf-dxfm-dim* "2D"))
(setq *gf-dxfm-dim* "3D"))
;; Block-Pfad: data/ils/3D/ wenn DXFM_DIM nicht gesetzt oder 2D
(if (null block-pfad)
(setq block-pfad
(cond
@@ -364,13 +366,13 @@
t
(progn
;; AS-Block laden und Masse extrahieren
(ensure-block-loaded "_3D_AS_90_links")
(if (tblsearch "BLOCK" "_3D_AS_90_links")
(ensure-block-loaded "AS_Element_90_links")
(if (tblsearch "BLOCK" "AS_Element_90_links")
(progn
(setq temp-obj
(vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_AS_90_links" 1.0 1.0 1.0 0))
"AS_Element_90_links" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein (cadr (assoc "KS_EIN" ks-data)))
@@ -384,13 +386,13 @@
)
)
;; ES-Block laden und Masse extrahieren
(ensure-block-loaded "_3D_ES_90_links")
(if (tblsearch "BLOCK" "_3D_ES_90_links")
(ensure-block-loaded "ES_Element_90_links")
(if (tblsearch "BLOCK" "ES_Element_90_links")
(progn
(setq temp-obj
(vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_ES_90_links" 1.0 1.0 1.0 0))
"ES_Element_90_links" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein (cadr (assoc "KS_EIN" ks-data)))
@@ -581,7 +583,7 @@
;; Blockname fuer Gefaellebogen
(defun gf-bogen-blockname (bwinkel bseite)
(strcat "Gefaellebogen_" bseite "_" (itoa bwinkel) grad-zeichen "_R500"))
(strcat "Gefaellebogen_" bseite "_" (itoa bwinkel) "_R500"))
;; dx und dz eines Gefaellebogen-Blocks extrahieren (KS_EIN -> KS_AUS)
;; Rueckgabe: (dx dz) dx = horizontale, dz = vertikale Verschiebung
@@ -911,7 +913,7 @@
;; DeltaH aus Z-Koordinaten
(setq deltaH (abs (- (caddr startpunkt) (caddr endpunkt-ref))))
(princ (strcat "\n DeltaH aus 3D-Punkten: " (rtos deltaH 2 1) " mm"))
(princ (strcat "\n " delta-sym "H aus 3D-Punkten: " (rtos deltaH 2 1) " mm"))
;; Kette sortieren
(princ "\n Sortiere Segmente ...")
@@ -929,21 +931,21 @@
(setq exit-hz (gf-exit-hz segmente))
;; Seite fuer AUS-Element (vor Winkelberechnung, da Laengenanpassung davon abhaengt)
(princ "\n\nAUS-Element (_3D_AS_90_*) - Seite waehlen:")
(princ "\n\nAUS-Element (AS_Element_90_*) - Seite waehlen:")
(princ "\n 1 - Links")
(princ "\n 2 - Rechts")
(setq antwort (getstring "\nIhre Wahl (1/2) [1]: "))
(setq as-seite (if (= antwort "2") "rechts" "links"))
;; Seite fuer EIN-Element
(princ "\n\nEIN-Element (_3D_ES_90_*) - Seite waehlen:")
(princ "\n\nEIN-Element (ES_Element_90_*) - Seite waehlen:")
(princ "\n 1 - Links")
(princ "\n 2 - Rechts")
(setq antwort (getstring "\nIhre Wahl (1/2) [1]: "))
(setq es-seite (if (= antwort "2") "rechts" "links"))
(setq as-block (strcat "_3D_AS_90_" as-seite))
(setq es-block (strcat "_3D_ES_90_" es-seite))
(setq as-block (strcat "AS_Element_90_" as-seite))
(setq es-block (strcat "ES_Element_90_" es-seite))
;; Segmentlaengen anpassen.
;; Die gezeichneten Linien enthalten die Laengen von AUS-/EIN-Element UND Separatoren.
@@ -1027,7 +1029,7 @@
;; Zusammenfassung
(princ "\n\n=========================================")
(princ (strcat "\n>>> Segmente: " (itoa (length segmente))))
(princ (strcat "\n>>> DeltaH: " (rtos deltaH 2 1) " mm"))
(princ (strcat "\n>>> " delta-sym "H: " (rtos deltaH 2 1) " mm"))
(princ (strcat "\n>>> Gefaellewinkel: " (rtos grade 2 3) grad-zeichen))
(princ (strcat "\n>>> Eintrittswinkel: " (rtos entry-hz 2 1) grad-zeichen))
(princ (strcat "\n>>> Austrittswinkel: " (rtos exit-hz 2 1) grad-zeichen))
@@ -1217,8 +1219,8 @@
(setq label-txt
(strcat "GF" (itoa gf-nummer)
" von:" (itoa (fix hoehe-von)) " bis:" (itoa (fix hoehe-bis)) "mm"
" dH=" (itoa (fix (abs deltaH))) "mm"
" dL=" (itoa (fix deltaL)) "mm"
" " delta-sym "H=" (itoa (fix (abs deltaH))) "mm"
" " delta-sym "L=" (itoa (fix deltaL)) "mm"
" L=[" L-gf-str "]m"
" W=" (rtos (float winkel) 2 2) grad-zeichen
" Sep=" (itoa n-separator)))
@@ -1309,8 +1311,8 @@
gf-nummer last-ent rad gf-deltaH L-gf-str
nach-aus-pt)
(setq aktueller-punkt startpunkt)
(setq as-block (strcat "_3D_AS_90_" seite))
(setq es-block (strcat "_3D_ES_90_" seite))
(setq as-block (strcat "AS_Element_90_" seite))
(setq es-block (strcat "ES_Element_90_" seite))
(if (not *lib-initialized*) (gf-init-bibliothek))
;; GF-Nummer und Entity-Grenze vor erster Einfuegung
@@ -1408,7 +1410,7 @@
(getpoint "\nStartpunkt fuer AUS_Element waehlen: "))
(if (null startpunkt-fuer-einfuegen)
(setq startpunkt-fuer-einfuegen '(0 0 0)))
(setq deltaL (getreal "\nAbstand deltaL (mm): "))
(setq deltaL (getreal (strcat "\n" delta-sym "L - Abstand (mm): ")))
(if (or (null deltaL) (<= deltaL 0))
(setq deltaL (ssg-cfg-or "gefaelle" "default_delta_l" 5000.0)))
)
@@ -1431,13 +1433,13 @@
(setq deltaL (max deltaX deltaY))
(princ (strcat "\n deltaX=" (rtos deltaX 2 2)
" mm, deltaY=" (rtos deltaY 2 2) " mm"))
(princ (strcat "\n deltaL = " (rtos deltaL 2 2) " mm"))
(princ (strcat "\n " delta-sym "L = " (rtos deltaL 2 2) " mm"))
(setq startpunkt-fuer-einfuegen startpunkt)
)
)
(princ "\n\n=========================================")
(princ (strcat "\n deltaL = " (rtos deltaL 2 2) " mm"))
(princ (strcat "\n " delta-sym "L = " (rtos deltaL 2 2) " mm"))
(princ "\n=========================================")
;; Winkelabfrage
@@ -1450,8 +1452,8 @@
;; Seite waehlen
(princ "\n\nEin-/Auselement - Seite waehlen:")
(princ "\n 1 - Links (_3D_AS_90_links / _3D_ES_90_links)")
(princ "\n 2 - Rechts (_3D_AS_90_rechts / _3D_ES_90_rechts)")
(princ "\n 1 - Links (AS_Element_90_links / ES_Element_90_links)")
(princ "\n 2 - Rechts (AS_Element_90_rechts / ES_Element_90_rechts)")
(setq antwort (getstring "\nIhre Wahl (1/2) [1]: "))
(if (= antwort "2") (setq seite "rechts") (setq seite "links"))
(princ (strcat "\n>>> Seite: " seite))
+4 -3
View File
@@ -11,10 +11,11 @@
;; ============================================================
;; TEIL 1: ABHAENGIGKEITEN
;; ============================================================
;; DXFM_DIM sicher lesen (type-Guard gegen nicht-String Rueckgabewerte)
;; DXFM_DIM lesen; 2D wird auf 3D korrigiert (VF/GF benoetigen Z-Geometrie)
(setq *vf-dxfm-dim* (getenv "DXFM_DIM"))
(if (not (= (type *vf-dxfm-dim*) 'STR)) (setq *vf-dxfm-dim* "3D"))
;; Block-Pfad: primaer aus DXFMAKRO + DXFM_DIM, dann *ssg-lisp-pfad*-Heuristik
(if (or (not (= (type *vf-dxfm-dim*) 'STR)) (= *vf-dxfm-dim* "2D"))
(setq *vf-dxfm-dim* "3D"))
;; Block-Pfad: data/ils/3D/ wenn DXFM_DIM nicht gesetzt oder 2D
(setq modul-pfad
(cond
((and (getenv "DXFMAKRO") (= (type (getenv "DXFMAKRO")) 'STR))
+22 -24
View File
@@ -47,7 +47,7 @@
;; ============================================================
(defun init-bibliothek-etage ( / temp-obj ks-data ks-ein-pos ks-aus-pos
gefaelle-blockname)
(if (and *etage-lib-initialized* (not (tblsearch "BLOCK" "_3D_AS_30_rechts")))
(if (and *etage-lib-initialized* (not (tblsearch "BLOCK" "AS_Element_30_rechts")))
(setq *etage-lib-initialized* nil))
(if *etage-lib-initialized*
(progn (princ "\n Etage-Bibliothek bereits initialisiert.") t)
@@ -61,13 +61,13 @@
;; AS_30_rechts Masse extrahieren
(princ "\n Extrahiere AS_30_rechts Masse...")
(ensure-block-loaded "_3D_AS_30_rechts")
(ensure-block-loaded "_3D_AS_30_links")
(if (tblsearch "BLOCK" "_3D_AS_30_rechts")
(ensure-block-loaded "AS_Element_30_rechts")
(ensure-block-loaded "AS_Element_30_links")
(if (tblsearch "BLOCK" "AS_Element_30_rechts")
(progn
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_AS_30_rechts" 1.0 1.0 1.0 0))
"AS_Element_30_rechts" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein-pos nil ks-aus-pos nil)
@@ -89,20 +89,20 @@
)
)
(progn
(princ "\n WARNUNG: Block _3D_AS_30_rechts fehlt - Standardwerte")
(princ "\n WARNUNG: Block AS_Element_30_rechts fehlt - Standardwerte")
(setq etage-aus-dx 525.8 etage-aus-dz -72.9)
)
)
;; ES_30_rechts Masse extrahieren
(princ "\n Extrahiere ES_30_rechts Masse...")
(ensure-block-loaded "_3D_ES_30_rechts")
(ensure-block-loaded "_3D_ES_30_links")
(if (tblsearch "BLOCK" "_3D_ES_30_rechts")
(ensure-block-loaded "ES_Element_30_rechts")
(ensure-block-loaded "ES_Element_30_links")
(if (tblsearch "BLOCK" "ES_Element_30_rechts")
(progn
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_ES_30_rechts" 1.0 1.0 1.0 0))
"ES_Element_30_rechts" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein-pos nil ks-aus-pos nil)
@@ -124,14 +124,13 @@
)
)
(progn
(princ "\n WARNUNG: Block _3D_ES_30_rechts fehlt - Standardwerte")
(princ "\n WARNUNG: Block ES_Element_30_rechts fehlt - Standardwerte")
(setq etage-ein-dx 576.2 etage-ein-dz -54.6)
)
)
;; Gefaellebogen_links_60 Masse extrahieren
(setq gefaelle-blockname
(strcat "Gefaellebogen_links_60" grad-zeichen "_R500"))
(setq gefaelle-blockname "Gefaellebogen_links_60_R500")
(princ (strcat "\n Extrahiere " gefaelle-blockname " Masse..."))
(ensure-block-loaded gefaelle-blockname)
(if (tblsearch "BLOCK" gefaelle-blockname)
@@ -165,8 +164,7 @@
" dz=" (rtos etage-gef-dz-links 2 2) " mm"))
;; Gefaellebogen_rechts_60 Masse extrahieren
(setq gefaelle-blockname
(strcat "Gefaellebogen_rechts_60" grad-zeichen "_R500"))
(setq gefaelle-blockname "Gefaellebogen_rechts_60_R500")
(princ (strcat "\n Extrahiere " gefaelle-blockname " Masse..."))
(ensure-block-loaded gefaelle-blockname)
(if (tblsearch "BLOCK" gefaelle-blockname)
@@ -618,15 +616,15 @@
(setq hz-vorzeichen (if (= seite "rechts") 1 -1))
(setq hz-anfang (* hz-vorzeichen ETAGE_HZ_WINKEL))
(setq hz-ende (* (- hz-vorzeichen) ETAGE_HZ_WINKEL))
(setq as-block (strcat "_3D_AS_30_" seite))
(setq es-block (strcat "_3D_ES_30_" seite))
(setq as-block (strcat "AS_Element_30_" seite))
(setq es-block (strcat "ES_Element_30_" seite))
(setq gefaelle-blockname
(if (= seite "rechts")
(strcat "Gefaellebogen_rechts_60" grad-zeichen "_R500")
(strcat "Gefaellebogen_links_60" grad-zeichen "_R500")
"Gefaellebogen_rechts_60_R500"
"Gefaellebogen_links_60_R500"
))
;; Sentinel: Bibliothek neu initialisieren wenn Bloecke fehlen
(if (and *etage-lib-initialized* (not (tblsearch "BLOCK" "_3D_AS_30_rechts")))
(if (and *etage-lib-initialized* (not (tblsearch "BLOCK" "AS_Element_30_rechts")))
(setq *etage-lib-initialized* nil))
(if (not *etage-lib-initialized*) (init-bibliothek-etage))
@@ -672,11 +670,11 @@
;; 7. 1. Vertikalbogen (3 Grad geneigt)
(if (= richtung "Auf")
(progn
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
)
(progn
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
)
)
@@ -711,11 +709,11 @@
;; 9. 2. Vertikalbogen
(if (= richtung "Auf")
(progn
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
)
(progn
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
)
)
+23 -23
View File
@@ -60,12 +60,12 @@
'(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"
(list "AS_Element_90_links" "AS_Element_90_rechts"
"ES_Element_90_links" "ES_Element_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)
(mapcar (function (lambda (w) (strcat "Vario_Bogen_auf_" (itoa w)))) bogen-winkel)
(mapcar (function (lambda (w) (strcat "Vario_Bogen_ab_" (itoa w)))) bogen-winkel)
)
)
(setq missing '())
@@ -95,7 +95,7 @@
;; ============================================================
(defun init-bibliothek ( / temp-obj bogen-winkel ks-data ks-ein-pos ks-aus-pos
dx dy dz bogen-name)
(if (and *lib-initialized* (tblsearch "BLOCK" "_3D_AS_90_links"))
(if (and *lib-initialized* (tblsearch "BLOCK" "AS_Element_90_links"))
(progn
(princ "\n Standard-Bibliothek bereits initialisiert.")
t
@@ -109,13 +109,13 @@
;; AS_90 Masse extrahieren
(princ "\n Extrahiere AUS_Element Masse...")
(ensure-block-loaded "_3D_AS_90_links")
(ensure-block-loaded "_3D_AS_90_rechts")
(if (tblsearch "BLOCK" "_3D_AS_90_links")
(ensure-block-loaded "AS_Element_90_links")
(ensure-block-loaded "AS_Element_90_rechts")
(if (tblsearch "BLOCK" "AS_Element_90_links")
(progn
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_AS_90_links" 1.0 1.0 1.0 0))
"AS_Element_90_links" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein-pos nil ks-aus-pos nil)
@@ -134,18 +134,18 @@
(princ "\n FEHLER: KS_EIN/KS_AUS fehlt im AS_90!")
)
)
(princ "\n FEHLER: Block _3D_AS_90_links nicht geladen!")
(princ "\n FEHLER: Block AS_Element_90_links nicht geladen!")
)
;; ES_90 Masse extrahieren
(princ "\n Extrahiere EIN_Element Masse...")
(ensure-block-loaded "_3D_ES_90_links")
(ensure-block-loaded "_3D_ES_90_rechts")
(if (tblsearch "BLOCK" "_3D_ES_90_links")
(ensure-block-loaded "ES_Element_90_links")
(ensure-block-loaded "ES_Element_90_rechts")
(if (tblsearch "BLOCK" "ES_Element_90_links")
(progn
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
"_3D_ES_90_links" 1.0 1.0 1.0 0))
"ES_Element_90_links" 1.0 1.0 1.0 0))
(setq ks-data (extract-ks-from-block temp-obj))
(vla-Delete temp-obj)
(setq ks-ein-pos nil ks-aus-pos nil)
@@ -164,7 +164,7 @@
(princ "\n FEHLER: KS_EIN/KS_AUS fehlt im ES_90!")
)
)
(princ "\n FEHLER: Block _3D_ES_90_links nicht geladen!")
(princ "\n FEHLER: Block ES_Element_90_links nicht geladen!")
)
;; Bogen-Masse extrahieren
@@ -175,7 +175,7 @@
'(3 6 9 12 15 18 21 27 33 39 45 51)))
(foreach w bogen-winkel
;; Aufwaertsbogen
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa w) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa w)))
(ensure-block-loaded bogen-name)
(if (tblsearch "BLOCK" bogen-name)
(progn
@@ -203,7 +203,7 @@
(princ (strcat "\n FEHLER auf_" (itoa w) ": Block nicht geladen!"))
)
;; Abwaertsbogen
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa w) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa w)))
(ensure-block-loaded bogen-name)
(if (tblsearch "BLOCK" bogen-name)
(progn
@@ -406,8 +406,8 @@
bogen-mass bogen-dx bogen-dz
as-block es-block)
(setq aktueller-punkt startpunkt)
(setq as-block (strcat "_3D_AS_90_" seite))
(setq es-block (strcat "_3D_ES_90_" seite))
(setq as-block (strcat "AS_Element_90_" seite))
(setq es-block (strcat "ES_Element_90_" seite))
(if (not *lib-initialized*) (init-bibliothek))
;; 1. AUS_Element
@@ -444,11 +444,11 @@
;; 5. 1. Vertikalbogen
(if (= richtung "Auf")
(progn
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
)
(progn
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
)
)
@@ -484,11 +484,11 @@
;; 7. 2. Vertikalbogen
(if (= richtung "Auf")
(progn
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_ab_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-ab best-winkel))
)
(progn
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel) grad-zeichen))
(setq bogen-name (strcat "Vario_Bogen_auf_" (itoa best-winkel)))
(setq bogen-mass (get-bogen-mass bogen-auf best-winkel))
)
)