horizontale Fahrrichtung (0°/90°/180°/270°) fuer Variofoederer manuelle Werteingabe ergänzen. die Möglichkeit des Horizontal-Varioföerderes wurde bei Ab-Förderrichtung geprüft.
This commit is contained in:
+196
-72
@@ -427,7 +427,10 @@
|
||||
;; ============================================================
|
||||
;; TEIL 8: BLOCK-EINFUEGEFUNKTIONEN (gemeinsam fuer alle Typen)
|
||||
;; ============================================================
|
||||
(defun insert-block-by-ks (blockname einfuegepunkt / block-obj temp-obj ks-data ks-ein ks-aus offset ausgang)
|
||||
;; hz: horizontale Fahrtrichtung in Grad (0=Ost/+X, 90=Nord/+Y, ...). Block
|
||||
;; hat sonst keine Neigung, daher nur Rz-Rotation (keine Ry-Komponente).
|
||||
(defun insert-block-by-ks (blockname einfuegepunkt hz / block-obj temp-obj ks-data ks-ein ks-aus
|
||||
rad-h chv shv ein-x ein-y ein-z dx-loc dy-loc dz-loc offset ausgang)
|
||||
(if (or (null einfuegepunkt) (not (listp einfuegepunkt)))
|
||||
(progn
|
||||
(princ (strcat "\n FEHLER: Ungueltiger Einfuegepunkt fuer '" blockname "'"))
|
||||
@@ -441,7 +444,9 @@
|
||||
(exit)
|
||||
)
|
||||
)
|
||||
(princ (strcat "\n Fuege Block '" blockname "' ein..."))
|
||||
(princ (strcat "\n Fuege Block '" blockname "' ein... (hz=" (rtos (float hz) 2 1) (chr 176) ")"))
|
||||
(setq rad-h (* (float hz) (/ pi 180.0)))
|
||||
(setq chv (cos rad-h) shv (sin rad-h))
|
||||
;; KS_EIN/KS_AUS ueber eigenes Temp-Objekt am Ursprung ermitteln (nicht am
|
||||
;; spaeter tatsaechlich platzierten block-obj - extract-ks-from-block
|
||||
;; exploded das uebergebene Objekt intern), siehe insert-block-ks-to-ks.
|
||||
@@ -452,23 +457,40 @@
|
||||
(if (not (vlax-erased-p temp-obj)) (vla-Delete temp-obj))
|
||||
(setq ks-ein (cadr (assoc "KS_EIN" ks-data)))
|
||||
(setq ks-aus (cadr (assoc "KS_AUS" ks-data)))
|
||||
;; Block am Ursprung einfuegen (nicht direkt am einfuegepunkt), damit die
|
||||
;; Rz-Rotation um den Block-Ursprung dreht, nicht um die Weltachse.
|
||||
(setq block-obj (vla-InsertBlock modelspace
|
||||
(vlax-3D-point einfuegepunkt)
|
||||
(vlax-3D-point '(0 0 0))
|
||||
blockname 1.0 1.0 1.0 0))
|
||||
(if (> (abs hz) 0.0001)
|
||||
(vla-TransformBy block-obj (vlax-tmatrix
|
||||
(list (list chv (- shv) 0 0)
|
||||
(list shv chv 0 0)
|
||||
(list 0 0 1 0)
|
||||
(list 0 0 0 1))))
|
||||
)
|
||||
(if (and ks-ein ks-aus)
|
||||
(progn
|
||||
;; offset verschiebt block-obj so, dass KS_EIN (aktuell bei
|
||||
;; einfuegepunkt+lokalerVersatz) exakt auf einfuegepunkt zu liegen kommt.
|
||||
(setq offset (list (- (car (car ks-ein)))
|
||||
(- (cadr (car ks-ein)))
|
||||
(- (caddr (car ks-ein)))))
|
||||
(setq ein-x (car (car ks-ein)) ein-y (cadr (car ks-ein)) ein-z (caddr (car ks-ein)))
|
||||
;; Block-Ursprung so verschieben, dass das ROTIERTE KS_EIN exakt auf
|
||||
;; einfuegepunkt zu liegen kommt: Ursprung = einfuegepunkt - Rz(hz)*ks_ein_lokal
|
||||
(setq offset (list
|
||||
(- (car einfuegepunkt) (- (* chv ein-x) (* shv ein-y)))
|
||||
(- (cadr einfuegepunkt) (+ (* shv ein-x) (* chv ein-y)))
|
||||
(- (caddr einfuegepunkt) ein-z)))
|
||||
(vla-Move block-obj
|
||||
(vlax-3D-point '(0 0 0))
|
||||
(vlax-3D-point offset))
|
||||
(setq ausgang (list (+ (car einfuegepunkt) (car (car ks-aus)) (car offset))
|
||||
(+ (cadr einfuegepunkt) (cadr (car ks-aus)) (cadr offset))
|
||||
(+ (caddr einfuegepunkt) (caddr (car ks-aus)) (caddr offset))))
|
||||
;; KS_AUS = einfuegepunkt + Rz(hz)*(ks_aus_lokal - ks_ein_lokal)
|
||||
(setq dx-loc (- (car (car ks-aus)) ein-x))
|
||||
(setq dy-loc (- (cadr (car ks-aus)) ein-y))
|
||||
(setq dz-loc (- (caddr (car ks-aus)) ein-z))
|
||||
(setq ausgang (list
|
||||
(+ (car einfuegepunkt) (- (* chv dx-loc) (* shv dy-loc)))
|
||||
(+ (cadr einfuegepunkt) (+ (* shv dx-loc) (* chv dy-loc)))
|
||||
(+ (caddr einfuegepunkt) dz-loc)))
|
||||
(princ (strcat "\n KS_AUS: X=" (rtos (car ausgang) 2 2)
|
||||
" Y=" (rtos (cadr ausgang) 2 2)
|
||||
" Z=" (rtos (caddr ausgang) 2 2)))
|
||||
ausgang
|
||||
)
|
||||
@@ -656,8 +678,10 @@
|
||||
" Z=" (rtos (caddr P-out) 2 2)))
|
||||
(list P-out xu-out yu-out zu-out))
|
||||
|
||||
(defun insert-inclined-scaled-block (blockname startpunkt laenge winkel /
|
||||
rad matrix block-obj endpunkt scale)
|
||||
;; hz: horizontale Fahrtrichtung in Grad (0=Ost/+X, 90=Nord/+Y, ...),
|
||||
;; winkel: vertikale Neigung in Grad. Rotation = Rz(hz)*Ry(winkel).
|
||||
(defun insert-inclined-scaled-block (blockname startpunkt laenge winkel hz /
|
||||
rad-v rad-h chv shv cvv svv matrix block-obj endpunkt scale)
|
||||
(if (<= laenge 0.1)
|
||||
(progn
|
||||
(princ (strcat "\n Laenge=" (rtos laenge 2 2) " mm -> uebersprungen"))
|
||||
@@ -672,26 +696,32 @@
|
||||
)
|
||||
)
|
||||
(princ (strcat "\n Fuege '" blockname "' ein"
|
||||
" (L=" (rtos laenge 2 2) " mm, W=" (itoa winkel) (chr 176) ")"))
|
||||
" (L=" (rtos laenge 2 2) " mm, W=" (itoa winkel) (chr 176)
|
||||
" hz=" (rtos (float hz) 2 1) (chr 176) ")"))
|
||||
(setq scale (/ laenge (ssg-cfg-or "vario" "skalierung_basis" 1000.0)))
|
||||
(setq rad (* winkel (/ pi 180.0)))
|
||||
(setq rad-v (* (float winkel) (/ pi 180.0)))
|
||||
(setq rad-h (* (float hz) (/ pi 180.0)))
|
||||
(setq chv (cos rad-h) shv (sin rad-h) cvv (cos rad-v) svv (sin rad-v))
|
||||
(setq block-obj (vla-InsertBlock modelspace
|
||||
(vlax-3D-point '(0 0 0))
|
||||
blockname scale 1.0 1.0 0))
|
||||
(setq matrix (list
|
||||
(list (cos rad) 0 (sin rad) 0)
|
||||
(list 0 1 0 0)
|
||||
(list (- (sin rad)) 0 (cos rad) 0)
|
||||
(list (* chv cvv) (- shv) (* chv svv) 0)
|
||||
(list (* shv cvv) chv (* shv svv) 0)
|
||||
(list (- svv) 0 cvv 0)
|
||||
(list 0 0 0 1)
|
||||
))
|
||||
(vla-TransformBy block-obj (vlax-tmatrix matrix))
|
||||
(vla-Move block-obj
|
||||
(vlax-3D-point '(0 0 0))
|
||||
(vlax-3D-point startpunkt))
|
||||
(setq endpunkt (list (+ (car startpunkt) (* laenge (cos rad)))
|
||||
(cadr startpunkt)
|
||||
(+ (caddr startpunkt) (* (- (sin rad)) laenge))))
|
||||
(princ (strcat "\n Endpunkt: Z=" (rtos (caddr endpunkt) 2 2)))
|
||||
(setq endpunkt (list
|
||||
(+ (car startpunkt) (* laenge chv cvv))
|
||||
(+ (cadr startpunkt) (* laenge shv cvv))
|
||||
(+ (caddr startpunkt) (* laenge (- svv)))))
|
||||
(princ (strcat "\n Endpunkt: X=" (rtos (car endpunkt) 2 2)
|
||||
" Y=" (rtos (cadr endpunkt) 2 2)
|
||||
" Z=" (rtos (caddr endpunkt) 2 2)))
|
||||
endpunkt
|
||||
)
|
||||
)
|
||||
@@ -710,8 +740,10 @@
|
||||
;; vorhanden, wird der ECHTE gemessene Versatz KS_AUS-KS_EIN verwendet -
|
||||
;; das schuetzt vor veralteten Config-Zahlen, die nicht mehr zur
|
||||
;; tatsaechlichen Blockgeometrie passen (z.B. nach einer DWG-Bereinigung).
|
||||
(defun insert-rotated-block-with-ks (blockname startpunkt winkel block-dx block-dz /
|
||||
rad matrix block-obj temp-obj ks-data
|
||||
;; hz: horizontale Fahrtrichtung in Grad (0=Ost/+X, 90=Nord/+Y, ...),
|
||||
;; winkel: vertikale Neigung in Grad. Rotation = Rz(hz)*Ry(winkel).
|
||||
(defun insert-rotated-block-with-ks (blockname startpunkt winkel block-dx block-dz hz /
|
||||
rad-v rad-h chv shv cvv svv matrix block-obj temp-obj ks-data
|
||||
ks-ein-raw ks-aus-raw
|
||||
ein-x ein-y ein-z aus-x aus-y aus-z
|
||||
dx dz ins-pt endpunkt)
|
||||
@@ -729,8 +761,11 @@
|
||||
)
|
||||
)
|
||||
(princ (strcat "\n Fuege Block '" blockname "' ein"
|
||||
" (Rotation " (itoa winkel) (chr 176) ")"))
|
||||
(setq rad (* winkel (/ pi 180.0)))
|
||||
" (Rotation " (itoa winkel) (chr 176)
|
||||
" hz=" (rtos (float hz) 2 1) (chr 176) ")"))
|
||||
(setq rad-v (* winkel (/ pi 180.0)))
|
||||
(setq rad-h (* (float hz) (/ pi 180.0)))
|
||||
(setq chv (cos rad-h) shv (sin rad-h) cvv (cos rad-v) svv (sin rad-v))
|
||||
;; Lokale KS_EIN/KS_AUS-Position ueber EIGENES Temp-Objekt ermitteln
|
||||
;; (nicht am spaeter tatsaechlich platzierten block-obj -
|
||||
;; extract-ks-from-block exploded das uebergebene Objekt intern; das
|
||||
@@ -764,26 +799,27 @@
|
||||
(vlax-3D-point '(0 0 0))
|
||||
blockname 1.0 1.0 1.0 0))
|
||||
(setq matrix (list
|
||||
(list (cos rad) 0 (sin rad) 0)
|
||||
(list 0 1 0 0)
|
||||
(list (- (sin rad)) 0 (cos rad) 0)
|
||||
(list (* chv cvv) (- shv) (* chv svv) 0)
|
||||
(list (* shv cvv) chv (* shv svv) 0)
|
||||
(list (- svv) 0 cvv 0)
|
||||
(list 0 0 0 1)
|
||||
))
|
||||
(vla-TransformBy block-obj (vlax-tmatrix matrix))
|
||||
;; Block-Ursprung so verschieben, dass das ROTIERTE KS_EIN exakt auf
|
||||
;; startpunkt liegt: Ursprung = startpunkt - Rot(ks_ein_lokal)
|
||||
;; startpunkt liegt: Ursprung = startpunkt - Rz(hz)*Ry(winkel)*ks_ein_lokal
|
||||
(setq ins-pt (list
|
||||
(- (car startpunkt) (+ (* ein-x (cos rad)) (* ein-z (sin rad))))
|
||||
(- (cadr startpunkt) ein-y)
|
||||
(- (caddr startpunkt) (+ (* (- (sin rad)) ein-x) (* (cos rad) ein-z)))))
|
||||
(- (car startpunkt) (+ (* ein-x chv cvv) (* ein-y (- shv)) (* ein-z chv svv)))
|
||||
(- (cadr startpunkt) (+ (* ein-x shv cvv) (* ein-y chv) (* ein-z shv svv)))
|
||||
(- (caddr startpunkt) (+ (* ein-x (- svv)) (* ein-z cvv)))))
|
||||
(vla-Move block-obj
|
||||
(vlax-3D-point '(0 0 0))
|
||||
(vlax-3D-point ins-pt))
|
||||
(setq endpunkt (list
|
||||
(+ (car startpunkt) (+ (* dx (cos rad)) (* dz (sin rad))))
|
||||
(cadr startpunkt)
|
||||
(+ (caddr startpunkt) (+ (* (- (sin rad)) dx) (* (cos rad) dz)))))
|
||||
(+ (car startpunkt) (+ (* dx chv cvv) (* dz chv svv)))
|
||||
(+ (cadr startpunkt) (+ (* dx shv cvv) (* dz shv svv)))
|
||||
(+ (caddr startpunkt) (+ (* dx (- svv)) (* dz cvv)))))
|
||||
(princ (strcat "\n Endpunkt: X=" (rtos (car endpunkt) 2 2)
|
||||
" Y=" (rtos (cadr endpunkt) 2 2)
|
||||
" Z=" (rtos (caddr endpunkt) 2 2)
|
||||
" (dx=" (rtos dx 2 1) " dz=" (rtos dz 2 1) ")"))
|
||||
endpunkt
|
||||
@@ -795,7 +831,7 @@
|
||||
;; TEIL 9: GEMEINSAME EINGABE-ABFRAGE
|
||||
;; ============================================================
|
||||
(defun vf-eingabe-abfragen ( / eingabe-modus line-points startpunkt endpunkt differenz
|
||||
deltaL deltaH deltaX deltaY richtung antwort)
|
||||
deltaL deltaH deltaX deltaY richtung antwort hz-winkel)
|
||||
(princ "\n\nEingabemodus waehlen:")
|
||||
(princ "\n 1 - 3D-Linie auswaehlen (Start- und Endpunkt mit Hoehe)")
|
||||
(princ "\n 2 - Werte manuell eingeben")
|
||||
@@ -822,8 +858,12 @@
|
||||
deltaY (abs (cadr differenz))
|
||||
deltaH (caddr differenz))
|
||||
(setq deltaL (max deltaX deltaY))
|
||||
;; Fahrtrichtung aus der Linie ableiten (0=Ost, 90=Nord, ...)
|
||||
(setq hz-winkel
|
||||
(* (angle '(0.0 0.0) (list (car differenz) (cadr differenz))) (/ 180.0 pi)))
|
||||
(princ (strcat "\n △L=" (rtos deltaL 2 2) " mm"
|
||||
" △H=" (rtos deltaH 2 2) " mm"))
|
||||
" △H=" (rtos deltaH 2 2) " mm"
|
||||
" Fahrtrichtung=" (rtos hz-winkel 2 1) grad-zeichen))
|
||||
(if (>= deltaH 0)
|
||||
(progn (setq richtung "Auf") (princ "\n Foerderrichtung: AUF"))
|
||||
(progn (setq richtung "Ab") (setq deltaH (abs deltaH))
|
||||
@@ -836,25 +876,56 @@
|
||||
(if (null deltaL) (setq deltaL 15000))
|
||||
(setq deltaH (getreal "\n△H - Hoehenunterschied (mm): "))
|
||||
(if (null deltaH) (setq deltaH 3000))
|
||||
;; Foerderrichtung bleibt eine einfache Auf/Ab-Frage - die horizontale
|
||||
;; Zwischenstrecke ist geometrisch NUR bei "Ab" ueberhaupt erreichbar
|
||||
;; (die festen 3-Grad-Elemente wirken immer absenkend) und wird daher
|
||||
;; erst SPAETER, nach Bibliotheks-Init, als Zusatzoption in der
|
||||
;; Winkel-Auswahl angeboten (siehe c:VarioFoerderer) - einheitlich fuer
|
||||
;; Werteingabe UND 3D-Linie.
|
||||
(princ "\nFoerderrichtung:\n 1 - AUF\n 2 - AB")
|
||||
(setq antwort (getstring "\nIhre Wahl (1/2): "))
|
||||
(if (= antwort "2") (setq richtung "Ab") (setq richtung "Auf"))
|
||||
(setq startpunkt (getpoint "\nStartpunkt fuer AUS_Element waehlen: "))
|
||||
(if (null startpunkt) (setq startpunkt '(0 0 0)))
|
||||
;; Horizontale Fahrtrichtung waehlen (analog Gefaellestrecke Modus 1)
|
||||
(princ "\n\nFahrtrichtung waehlen:")
|
||||
(princ "\n 1 - 0° (X-Achse +, Ost)")
|
||||
(princ "\n 2 - 90° (Y-Achse +, Nord)")
|
||||
(princ "\n 3 - 180° (X-Achse -, West)")
|
||||
(princ "\n 4 - 270° (Y-Achse -, Sued)")
|
||||
(setq antwort (getstring "\nIhre Wahl (1/2/3/4) [1]: "))
|
||||
(cond
|
||||
((= antwort "2") (setq hz-winkel 90.0))
|
||||
((= antwort "3") (setq hz-winkel 180.0))
|
||||
((= antwort "4") (setq hz-winkel 270.0))
|
||||
(t (setq hz-winkel 0.0))
|
||||
)
|
||||
(princ (strcat "\n>>> Fahrtrichtung: " (rtos hz-winkel 2 1) grad-zeichen))
|
||||
)
|
||||
)
|
||||
(list deltaL deltaH richtung startpunkt)
|
||||
(list deltaL deltaH richtung startpunkt hz-winkel eingabe-modus)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 10: VF_*-BLOCK-SYSTEM (gemeinsam fuer alle Typen)
|
||||
;; ============================================================
|
||||
(defun vf-make-label (vf-nummer hoehe-von hoehe-bis deltaH deltaL L_VF L_GF
|
||||
richtung best-winkel n-separator n-scanner startpunkt /
|
||||
label-txt label-pt L_VF_str L_GF_str delta-sym)
|
||||
;; hz: horizontale Fahrtrichtung in Grad (0=Ost/+X, 90=Nord/+Y, ...) - siehe
|
||||
;; variofoerderer-einfuegen. Beschriftungsposition wird ENTLANG dieser
|
||||
;; Richtung (halbe deltaL) und SENKRECHT dazu (200mm) versetzt, statt fest
|
||||
;; von +X auszugehen. Der Textwinkel rastet wie bei Gefaellestrecke immer
|
||||
;; auf 0 Grad (X-Achse) oder 90 Grad (Y-Achse) ein, damit er nie auf dem
|
||||
;; Kopf steht - unabhaengig von der tatsaechlichen Fahrtrichtung.
|
||||
;; L_GF1/L_GF2: die beiden Gefaellestrecken-Segmente (vorne/hinten) - werden
|
||||
;; als kommagetrennte Meter-Werte dargestellt (Punkt=Dezimaltrennzeichen,
|
||||
;; Komma=Segment-Trenner, analog L-gf-str in Gefaellestrecke.lsp), damit
|
||||
;; beide Werte eindeutig unterscheidbar bleiben.
|
||||
(defun vf-make-label (vf-nummer hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel n-separator n-scanner startpunkt hz /
|
||||
label-txt label-pt L_VF_str L_GF_str delta-sym
|
||||
chz-l shz-l halb basis-winkel)
|
||||
(setq delta-sym (chr 916))
|
||||
(setq L_VF_str (vl-string-subst "," "." (rtos (/ L_VF 1000.0) 2 3)))
|
||||
(setq L_GF_str (vl-string-subst "," "." (rtos (/ L_GF 1000.0) 2 3)))
|
||||
(setq L_GF_str (strcat (rtos (/ L_GF1 1000.0) 2 3) "," (rtos (/ L_GF2 1000.0) 2 3)))
|
||||
(setq label-txt
|
||||
(strcat "VF" (itoa vf-nummer)
|
||||
": von " (itoa (fix hoehe-von)) "mm bis " (itoa (fix hoehe-bis)) "mm, "
|
||||
@@ -863,10 +934,19 @@
|
||||
"VF:" L_VF_str "m; GF:" L_GF_str "m; "
|
||||
richtung ": " (itoa best-winkel) grad-zeichen "; "
|
||||
"Sep: " (itoa n-separator) "; Scan: " (itoa n-scanner)))
|
||||
(setq chz-l (cos (* (float hz) (/ pi 180.0))))
|
||||
(setq shz-l (sin (* (float hz) (/ pi 180.0))))
|
||||
(setq halb (/ (float deltaL) 2.0))
|
||||
(setq label-pt (list
|
||||
(+ (car startpunkt) (/ deltaL 2.0))
|
||||
(- (cadr startpunkt) 200.0)
|
||||
(+ (car startpunkt) (* halb chz-l) (* 200.0 shz-l))
|
||||
(+ (cadr startpunkt) (* halb shz-l) (* -200.0 chz-l))
|
||||
(caddr startpunkt)))
|
||||
;; Textwinkel auf 0/90 Grad einrasten (nie kopfueber, unabhaengig von hz)
|
||||
(setq basis-winkel (float hz))
|
||||
(while (< basis-winkel 0.0) (setq basis-winkel (+ basis-winkel 360.0)))
|
||||
(while (>= basis-winkel 360.0) (setq basis-winkel (- basis-winkel 360.0)))
|
||||
(if (>= basis-winkel 180.0) (setq basis-winkel (- basis-winkel 180.0)))
|
||||
(setq basis-winkel (if (or (< basis-winkel 45.0) (>= basis-winkel 135.0)) 0.0 90.0))
|
||||
(entmake (list
|
||||
'(0 . "TEXT")
|
||||
(cons 8 "VF_Beschriftung")
|
||||
@@ -874,7 +954,7 @@
|
||||
(cons 10 label-pt)
|
||||
(cons 40 100.0)
|
||||
(cons 1 label-txt)
|
||||
(cons 50 0.0)
|
||||
(cons 50 (* basis-winkel (/ pi 180.0)))
|
||||
'(72 . 1)
|
||||
'(73 . 2)
|
||||
(cons 11 label-pt)
|
||||
@@ -904,12 +984,13 @@
|
||||
;; Erstellt VF_N-Block aus allen seit lastEnt erzeugten Entities.
|
||||
;; Setzt Attributwerte entsprechend Typ, Seite und Geometrieparametern.
|
||||
(defun vf-block-erstellen (anlage-typ seite vf-nummer n-scanner
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF
|
||||
richtung best-winkel startpunkt lastEnt
|
||||
/ vf-bname vf-ss vf-e vf-insert montagehoehe-m attdef-ypos)
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz
|
||||
/ vf-bname vf-ss vf-e vf-insert montagehoehe-m attdef-ypos L_GF_m-str)
|
||||
(if (null hz) (setq hz 0.0))
|
||||
;; Beschriftungstext erzeugen
|
||||
(vf-make-label vf-nummer hoehe-von hoehe-bis deltaH deltaL L_VF L_GF
|
||||
richtung best-winkel 2 n-scanner startpunkt)
|
||||
(vf-make-label vf-nummer hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel 2 n-scanner startpunkt hz)
|
||||
|
||||
;; Unsichtbare ATTDEFs am Startpunkt erzeugen
|
||||
(setq attdef-ypos (cadr startpunkt))
|
||||
@@ -950,6 +1031,9 @@
|
||||
(setvar "ATTREQ" 1)
|
||||
(setq vf-insert (entlast))
|
||||
(setq montagehoehe-m (/ (+ hoehe-von hoehe-bis) 2000.0))
|
||||
;; L_GF_m: kommagetrennte Segmentlaengen in Metern (vorne,hinten),
|
||||
;; analog L_GF_m in Gefaellestrecke.lsp.
|
||||
(setq L_GF_m-str (strcat (rtos (/ L_GF1 1000.0) 2 3) "," (rtos (/ L_GF2 1000.0) 2 3)))
|
||||
(ssg-attrib-set-on vf-insert
|
||||
(list
|
||||
(cons "NUMMER" (itoa vf-nummer))
|
||||
@@ -959,7 +1043,7 @@
|
||||
(cons "DELTA_H" (itoa (fix deltaH)))
|
||||
(cons "DELTA_L" (itoa (fix deltaL)))
|
||||
(cons "L_VF_m" (rtos (/ L_VF 1000.0) 2 3))
|
||||
(cons "L_GF_m" (rtos (/ L_GF 1000.0) 2 3))
|
||||
(cons "L_GF_m" L_GF_m-str)
|
||||
(cons "ANTRIEBFAHRTRICHTUNG" richtung)
|
||||
(cons "WINKEL" (itoa best-winkel))
|
||||
(cons "ANZAHL_SEPARATOR" "2")
|
||||
@@ -1013,8 +1097,9 @@
|
||||
;; TEIL 12: DISPATCHER c:VarioFoerderer
|
||||
;; ============================================================
|
||||
(defun c:VarioFoerderer ( / typ-eintr anlage-typ berechne-fn einfuege-fn
|
||||
eingabe deltaL deltaH richtung startpunkt seite
|
||||
ergebnis ergebnis-liste gueltige-winkel
|
||||
eingabe deltaL deltaH richtung startpunkt seite hz
|
||||
eingabe-modus ergebnis ergebnis-liste gueltige-winkel
|
||||
horizontal-info
|
||||
best-winkel L_GF L_GF1 L_GF2 L_VF
|
||||
idx eintrag wahl antwort verteilung-modus
|
||||
n-scanner vf-nummer hoehe-von hoehe-bis lastEnt
|
||||
@@ -1062,12 +1147,15 @@
|
||||
(setq vf-nummer (vf-next-number))
|
||||
(princ (strcat "\n>>> Naechste VF-Nummer: VF" (itoa vf-nummer)))
|
||||
|
||||
;; 3. Gemeinsame Eingabe (deltaL, deltaH, richtung, startpunkt)
|
||||
;; 3. Gemeinsame Eingabe (deltaL, deltaH, richtung, startpunkt) - richtung
|
||||
;; steht bei beiden Eingabemodi (Werteingabe UND 3D-Linie) bereits fest.
|
||||
(setq eingabe (vf-eingabe-abfragen))
|
||||
(setq deltaL (nth 0 eingabe)
|
||||
deltaH (nth 1 eingabe)
|
||||
richtung (nth 2 eingabe)
|
||||
startpunkt (nth 3 eingabe))
|
||||
(setq deltaL (nth 0 eingabe)
|
||||
deltaH (nth 1 eingabe)
|
||||
richtung (nth 2 eingabe)
|
||||
startpunkt (nth 3 eingabe)
|
||||
hz (nth 4 eingabe)
|
||||
eingabe-modus (nth 5 eingabe))
|
||||
|
||||
;; 4. Seite-Auswahl (vor Berechnung, weil Etage-Typ sie fuer Geometrie braucht)
|
||||
(princ "\n\nSeite waehlen:")
|
||||
@@ -1077,11 +1165,31 @@
|
||||
(if (= antwort "2") (setq seite "links") (setq seite "rechts"))
|
||||
(princ (strcat "\n>>> Seite: " seite))
|
||||
|
||||
;; 5. Typ-spezifische Berechnung (init + berechne)
|
||||
;; 5. Typ-spezifische Berechnung (init + Winkelsuche)
|
||||
(setq ergebnis (apply berechne-fn (list deltaL deltaH richtung seite)))
|
||||
(setq ergebnis-liste (cadddr ergebnis))
|
||||
|
||||
;; 6. Konfiguration (nach ssg_core-Init verfuegbar)
|
||||
;; 5b. Horizontale Zwischenstrecke als Zusatzoption: geometrisch NUR bei
|
||||
;; "Ab" ueberhaupt erreichbar (die festen 3-Grad-Elemente wirken immer
|
||||
;; absenkend) - "Auf" wird deshalb gar nicht erst geprueft. Gilt einheitlich
|
||||
;; fuer Werteingabe UND 3D-Linie, da richtung hier in jedem Fall feststeht.
|
||||
;; Bibliothek ist durch den berechne-fn-Aufruf oben bereits initialisiert.
|
||||
(if (and (= anlage-typ "standard") (= richtung "Ab"))
|
||||
(progn
|
||||
(setq horizontal-info (berechne-horizontale-mitte deltaL deltaH "Ab"))
|
||||
(if (and horizontal-info (caddr horizontal-info))
|
||||
(progn
|
||||
(setq ergebnis-liste
|
||||
(append ergebnis-liste
|
||||
(list (list 0 (car horizontal-info) (cadr horizontal-info) T))))
|
||||
(princ "\n\n>>> Hinweis: Ein horizontale Variofoerderer ( 0°) ist bei diesem △L/△H zusaetzlich moeglich!")
|
||||
)
|
||||
(setq horizontal-info nil)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; Konfiguration (nach ssg_core-Init verfuegbar).
|
||||
(setq staustrecke-basis (ssg-cfg-or "vario" "staustrecke_basis" 1000))
|
||||
|
||||
;; 7. Gueltige Winkel ermitteln
|
||||
@@ -1102,22 +1210,33 @@
|
||||
)
|
||||
|
||||
;; 8. Winkelauswahl (automatisch oder interaktiv)
|
||||
;; Sentinel-Winkel 0 = horizontale Zwischenstrecke (Schritt 6/11 bei 0
|
||||
;; Grad, Boegen fest auf_3/ab_3) - siehe berechne-horizontale-mitte.
|
||||
(if (= (length gueltige-winkel) 1)
|
||||
(progn
|
||||
(setq best-winkel (car gueltige-winkel))
|
||||
(setq eintrag (assoc best-winkel ergebnis-liste))
|
||||
(setq L_GF (nth 1 eintrag) L_VF (nth 2 eintrag))
|
||||
(princ (strcat "\n\n>>> Einziger gueltiger Winkel: "
|
||||
(itoa best-winkel) (chr 176)))
|
||||
(if (= best-winkel 0)
|
||||
(princ "\n\n>>> Einzige gueltige Variante: Horizontale Variofoerderer")
|
||||
(princ (strcat "\n\n>>> Einziger gueltiger Winkel: "
|
||||
(itoa best-winkel) (chr 176)))
|
||||
)
|
||||
)
|
||||
(progn
|
||||
(princ "\n\nMehrere gueltige Winkel verfuegbar. Bitte waehlen:")
|
||||
(setq idx 1)
|
||||
(foreach w gueltige-winkel
|
||||
(setq eintrag (assoc w ergebnis-liste))
|
||||
(princ (strcat "\n " (itoa idx) " - " (itoa w) (chr 176)
|
||||
" (L_GF=" (rtos (nth 1 eintrag) 2 1)
|
||||
" mm, L_VF=" (rtos (nth 2 eintrag) 2 1) " mm)"))
|
||||
(if (= w 0)
|
||||
(princ (strcat "\n " (itoa idx) " - Horizontale Variofoerderer (0"
|
||||
(chr 176) ")"
|
||||
" (L_GF=" (rtos (nth 1 eintrag) 2 1)
|
||||
" mm, L_VF=" (rtos (nth 2 eintrag) 2 1) " mm)"))
|
||||
(princ (strcat "\n " (itoa idx) " - " (itoa w) (chr 176)
|
||||
" (L_GF=" (rtos (nth 1 eintrag) 2 1)
|
||||
" mm, L_VF=" (rtos (nth 2 eintrag) 2 1) " mm)"))
|
||||
)
|
||||
(setq idx (1+ idx))
|
||||
)
|
||||
(setq wahl (getint (strcat "Winkel waehlen (1-"
|
||||
@@ -1130,9 +1249,14 @@
|
||||
)
|
||||
)
|
||||
(princ "\n\n=========================================")
|
||||
(princ (strcat "\n>>> Winkel: " (itoa best-winkel) (chr 176)
|
||||
" L_GF: " (rtos L_GF 2 2) " mm"
|
||||
" L_VF: " (rtos L_VF 2 2) " mm"))
|
||||
(if (= best-winkel 0)
|
||||
(princ (strcat "\n>>> Horizontale Variofoerderer"
|
||||
" L_GF: " (rtos L_GF 2 2) " mm"
|
||||
" L_VF: " (rtos L_VF 2 2) " mm"))
|
||||
(princ (strcat "\n>>> Winkel: " (itoa best-winkel) (chr 176)
|
||||
" L_GF: " (rtos L_GF 2 2) " mm"
|
||||
" L_VF: " (rtos L_VF 2 2) " mm"))
|
||||
)
|
||||
(princ "\n=========================================")
|
||||
|
||||
;; 9. L_GF Verteilung
|
||||
@@ -1186,12 +1310,12 @@
|
||||
|
||||
;; Typ-spezifische Einfuegung
|
||||
(apply einfuege-fn
|
||||
(list deltaL deltaH richtung best-winkel L_GF1 L_GF2 L_VF startpunkt seite))
|
||||
(list deltaL deltaH richtung best-winkel L_GF1 L_GF2 L_VF startpunkt seite hz))
|
||||
|
||||
;; Gemeinsame VF_*-Block-Erstellung
|
||||
(vf-block-erstellen anlage-typ seite vf-nummer n-scanner
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF
|
||||
richtung best-winkel startpunkt lastEnt)
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz)
|
||||
|
||||
(princ "\n=========================================")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user