korrigierte Fassung für z-Koordinaten rein
This commit is contained in:
+83
-34
@@ -417,7 +417,7 @@
|
|||||||
(setq matrix (list
|
(setq matrix (list
|
||||||
(list (cos rad) 0 (sin rad) (- tx (* tx (cos rad)) (* tz (sin rad))))
|
(list (cos rad) 0 (sin rad) (- tx (* tx (cos rad)) (* tz (sin rad))))
|
||||||
(list 0 1 0 (- ty ty))
|
(list 0 1 0 (- ty ty))
|
||||||
(list (- (sin rad)) 0 (cos rad) (- tz (* tx (sin rad)) (* tz (cos rad))))
|
(list (- (sin rad)) 0 (cos rad) (+ tz (* tx (sin rad)) (- (* tz (cos rad)))))
|
||||||
(list 0 0 0 1)
|
(list 0 0 0 1)
|
||||||
))
|
))
|
||||||
(vla-TransformBy obj (vlax-tmatrix matrix))
|
(vla-TransformBy obj (vlax-tmatrix matrix))
|
||||||
@@ -969,48 +969,97 @@
|
|||||||
;; Speichert als datum-HHMM.dxf
|
;; Speichert als datum-HHMM.dxf
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
(defun c:FOERDERTEST ( / deltaL deltaH richtung ergebnis
|
(defun c:FOERDERTEST ( / deltaL deltaH richtung ergebnis
|
||||||
best-winkel L_GF L_VF dateiname)
|
best-winkel L_GF L_VF dateiname
|
||||||
(setq deltaL 8000)
|
y-offset hoehen-liste idx)
|
||||||
(setq deltaH 3000)
|
(setq deltaL 7000)
|
||||||
(setq richtung "Auf")
|
(setq hoehen-liste '(0 1000 2000 3000 4000 5000))
|
||||||
|
(setq y-offset 0)
|
||||||
|
(setq idx 0)
|
||||||
|
|
||||||
(princ "\n=========================================")
|
(princ "\n=========================================")
|
||||||
(princ "\n FOERDERTEST (automatisch)")
|
(princ "\n FOERDERTEST (12 Foerderer)")
|
||||||
(princ "\n=========================================")
|
(princ "\n=========================================")
|
||||||
(princ (strcat "\nDistanz: " (rtos deltaL 2 2) " mm"))
|
(princ (strcat "\nDistanz: " (rtos deltaL 2 2) " mm"))
|
||||||
(princ (strcat "\nHoehe: " (rtos deltaH 2 2) " mm"))
|
(princ "\nHoehen: 0 bis 5000 mm (6 Stufen)")
|
||||||
(princ (strcat "\nRichtung: " richtung))
|
(princ "\nRichtungen: Auf + Ab")
|
||||||
(princ "\nStartpunkt: 0, 0, 0")
|
|
||||||
|
|
||||||
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
;; 6 Foerderer aufwaerts
|
||||||
(setq best-winkel (car ergebnis) L_GF (cadr ergebnis) L_VF (caddr ergebnis))
|
(foreach deltaH hoehen-liste
|
||||||
|
(setq idx (1+ idx))
|
||||||
|
(setq richtung "Auf")
|
||||||
|
(princ (strcat "\n\n--- Foerderer " (itoa idx) "/12: " richtung " dH=" (rtos deltaH 2 0) " mm ---"))
|
||||||
|
|
||||||
(if (or (null best-winkel) (null L_GF) (null L_VF) (<= L_GF 0) (<= L_VF 0))
|
(if (< deltaH 1)
|
||||||
(progn (princ "\nFEHLER: Kein passender Winkel gefunden!") (princ))
|
(progn
|
||||||
(progn
|
;; deltaH=0: Flacher Foerderer, nur Gefaellestrecken bei 3 Grad
|
||||||
(princ (strcat "\n\nGewaehlter Winkel: " (itoa best-winkel) " Grad"))
|
(princ "\n Flach (deltaH=0), ueberspringe Winkelberechnung")
|
||||||
(princ (strcat "\nL_GF (gesamt): " (rtos L_GF 2 2) " mm"))
|
(setq best-winkel 3
|
||||||
(princ (strcat "\nL_GF1 (vorne): " (rtos (/ L_GF 2.0) 2 2) " mm"))
|
L_GF (- deltaL aus-dx ein-dx (* FESTE_HORIZONTAL (cos (* 3 (/ pi 180.0)))))
|
||||||
(princ (strcat "\nL_GF2 (hinten): " (rtos (/ L_GF 2.0) 2 2) " mm"))
|
L_VF 0)
|
||||||
(princ (strcat "\nL_VF: " (rtos L_VF 2 2) " mm"))
|
(if (> L_GF 0)
|
||||||
|
(foerderanlage-einfuegen deltaL 0 richtung best-winkel (/ L_GF 2.0) (/ L_GF 2.0) L_VF (list 0 y-offset 0))
|
||||||
;; Foerderanlage einfuegen bei 0,0,0 (gleichmaessige Verteilung)
|
(princ "\n FEHLER: L_GF negativ, Strecke zu kurz!")
|
||||||
(foerderanlage-einfuegen deltaL deltaH richtung best-winkel (/ L_GF 2.0) (/ L_GF 2.0) L_VF '(0 0 0))
|
)
|
||||||
|
)
|
||||||
;; Dateiname: datum-HHMM.dxf
|
(progn
|
||||||
(if (getenv "DXFM_RESULTS")
|
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
||||||
(setq result-pfad (getenv "DXFM_RESULTS"))
|
(setq best-winkel (car ergebnis) L_GF (cadr ergebnis) L_VF (caddr ergebnis))
|
||||||
(setq result-pfad (strcat modul-pfad "../results"))
|
(if (or (null best-winkel) (null L_GF) (null L_VF) (<= L_GF 0) (<= L_VF 0))
|
||||||
|
(princ "\n FEHLER: Kein passender Winkel gefunden!")
|
||||||
|
(progn
|
||||||
|
(princ (strcat "\n Winkel: " (itoa best-winkel) " Grad L_GF=" (rtos L_GF 2 1) " L_VF=" (rtos L_VF 2 1)))
|
||||||
|
(foerderanlage-einfuegen deltaL deltaH richtung best-winkel (/ L_GF 2.0) (/ L_GF 2.0) L_VF (list 0 y-offset 0))
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(setq dateiname (strcat result-pfad
|
|
||||||
"/"
|
|
||||||
(menucmd "M=$(edtime,$(getvar,date),YYYYMODD-HHmm)")
|
|
||||||
".dxf"))
|
|
||||||
(princ (strcat "\n\nSpeichere als: " dateiname))
|
|
||||||
(command "_.DXFOUT" dateiname "V" "2018" "16")
|
|
||||||
(princ "\n\n>>> FOERDERTEST abgeschlossen! <<<")
|
|
||||||
)
|
)
|
||||||
|
(setq y-offset (- y-offset 200))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; 6 Foerderer abwaerts
|
||||||
|
(foreach deltaH hoehen-liste
|
||||||
|
(setq idx (1+ idx))
|
||||||
|
(setq richtung "Ab")
|
||||||
|
(princ (strcat "\n\n--- Foerderer " (itoa idx) "/12: " richtung " dH=" (rtos deltaH 2 0) " mm ---"))
|
||||||
|
|
||||||
|
(if (< deltaH 1)
|
||||||
|
(progn
|
||||||
|
(princ "\n Flach (deltaH=0), ueberspringe Winkelberechnung")
|
||||||
|
(setq best-winkel 3
|
||||||
|
L_GF (- deltaL aus-dx ein-dx (* FESTE_HORIZONTAL (cos (* 3 (/ pi 180.0)))))
|
||||||
|
L_VF 0)
|
||||||
|
(if (> L_GF 0)
|
||||||
|
(foerderanlage-einfuegen deltaL 0 richtung best-winkel (/ L_GF 2.0) (/ L_GF 2.0) L_VF (list 0 y-offset 0))
|
||||||
|
(princ "\n FEHLER: L_GF negativ, Strecke zu kurz!")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(progn
|
||||||
|
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
||||||
|
(setq best-winkel (car ergebnis) L_GF (cadr ergebnis) L_VF (caddr ergebnis))
|
||||||
|
(if (or (null best-winkel) (null L_GF) (null L_VF) (<= L_GF 0) (<= L_VF 0))
|
||||||
|
(princ "\n FEHLER: Kein passender Winkel gefunden!")
|
||||||
|
(progn
|
||||||
|
(princ (strcat "\n Winkel: " (itoa best-winkel) " Grad L_GF=" (rtos L_GF 2 1) " L_VF=" (rtos L_VF 2 1)))
|
||||||
|
(foerderanlage-einfuegen deltaL deltaH richtung best-winkel (/ L_GF 2.0) (/ L_GF 2.0) L_VF (list 0 y-offset 0))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(setq y-offset (- y-offset 200))
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Dateiname: datum-HHMM.dxf
|
||||||
|
(if (getenv "DXFM_RESULTS")
|
||||||
|
(setq result-pfad (getenv "DXFM_RESULTS"))
|
||||||
|
(setq result-pfad (strcat modul-pfad "../results"))
|
||||||
|
)
|
||||||
|
(setq dateiname (strcat result-pfad
|
||||||
|
"/"
|
||||||
|
(menucmd "M=$(edtime,$(getvar,date),YYYYMODD-HHmm)")
|
||||||
|
".dxf"))
|
||||||
|
(princ (strcat "\n\nSpeichere als: " dateiname))
|
||||||
|
(command "_.DXFOUT" dateiname "V" "2018" "16")
|
||||||
|
(princ "\n\n>>> FOERDERTEST abgeschlossen (12 Foerderer)! <<<")
|
||||||
(princ)
|
(princ)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user