Merge branch 'master' of https://gitea.schoenenberger.de/Schoenenberger_Systeme_GmbH/dxfmakros
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+61
-5
@@ -46,6 +46,7 @@
|
||||
(setq *lib-initialized* nil)
|
||||
(setq *bogen-cache-loaded* nil)
|
||||
(setq *modul-cache* nil)
|
||||
(setq *ks-cache* nil) ;; KS-Daten Cache: (("blockname" ("KS_EIN" ...) ("KS_AUS" ...)) ...)
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 3: HILFSFUNKTIONEN
|
||||
@@ -72,6 +73,30 @@
|
||||
(list (- (car p2) (car p1)) (- (cadr p2) (cadr p1)) (- (caddr p2) (caddr p1)))
|
||||
)
|
||||
|
||||
;; KS-Daten relativ zu einem Basispunkt machen (fuer Cache)
|
||||
(defun ks-relativize (ks-data base-pt)
|
||||
(mapcar '(lambda (item)
|
||||
(list (car item)
|
||||
(mapcar '(lambda (pt)
|
||||
(list (- (car pt) (car base-pt))
|
||||
(- (cadr pt) (cadr base-pt))
|
||||
(- (caddr pt) (caddr base-pt))))
|
||||
(cadr item))))
|
||||
ks-data)
|
||||
)
|
||||
|
||||
;; Relative KS-Daten auf einen Basispunkt anwenden
|
||||
(defun ks-absolutize (ks-rel base-pt)
|
||||
(mapcar '(lambda (item)
|
||||
(list (car item)
|
||||
(mapcar '(lambda (pt)
|
||||
(list (+ (car pt) (car base-pt))
|
||||
(+ (cadr pt) (cadr base-pt))
|
||||
(+ (caddr pt) (caddr base-pt))))
|
||||
(cadr item))))
|
||||
ks-rel)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 4: KS_EIN/KS_AUS EXTRAKTION (KERN-FUNKTION)
|
||||
;; ============================================================
|
||||
@@ -79,13 +104,14 @@
|
||||
;; Grad-Zeichen für Blocknamen
|
||||
(setq grad-zeichen (chr 176))
|
||||
|
||||
;; Extrahiert KS_EIN und KS_AUS aus einem Block
|
||||
;; Extrahiert KS_EIN und KS_AUS aus einem Block (intern, ohne Cache)
|
||||
;; Rückgabe: (("KS_EIN" (origin x-end y-end z-end))
|
||||
;; ("KS_AUS" (origin x-end y-end z-end)))
|
||||
(defun extract-ks-from-block (block-obj / sub-entities sub-obj ks-results
|
||||
ks-ref inner-entities inner-obj origin x-end y-end z-end
|
||||
line-start line-end axis line-len line-vec)
|
||||
(dbgf "extract-ks-from-block")
|
||||
(defun extract-ks-from-block-raw (block-obj / sub-entities sub-obj ks-results
|
||||
ks-ref inner-entities inner-obj origin x-end y-end z-end
|
||||
line-start line-end axis line-len line-vec)
|
||||
(dbgf "extract-ks-from-block-raw")
|
||||
(dbg block-obj)
|
||||
(setq ks-results '())
|
||||
|
||||
;; Block explodieren
|
||||
@@ -144,6 +170,35 @@
|
||||
(dbgreturn ks-results)
|
||||
)
|
||||
|
||||
;; Gecachte Version: prueft *ks-cache* anhand Blockname
|
||||
;; Beim ersten Aufruf wird explodiert und das Ergebnis relativ
|
||||
;; zum Einfuegepunkt im Cache gespeichert. Weitere Aufrufe
|
||||
;; desselben Blocktyps liefern die Daten ohne Explode.
|
||||
(defun extract-ks-from-block (block-obj / blockname insert-pt cached result ks-rel)
|
||||
(dbgf "extract-ks-from-block")
|
||||
(setq blockname (vla-get-Name block-obj))
|
||||
(setq insert-pt (vlax-safearray->list
|
||||
(vlax-variant-value (vla-get-InsertionPoint block-obj))))
|
||||
(setq cached (assoc blockname *ks-cache*))
|
||||
(if cached
|
||||
(progn
|
||||
(dbg (strcat " KS-Cache HIT: " blockname))
|
||||
(dbgreturn (ks-absolutize (cdr cached) insert-pt))
|
||||
)
|
||||
(progn
|
||||
(dbg (strcat " KS-Cache MISS: " blockname))
|
||||
(setq result (extract-ks-from-block-raw block-obj))
|
||||
(if result
|
||||
(progn
|
||||
(setq ks-rel (ks-relativize result insert-pt))
|
||||
(setq *ks-cache* (cons (cons blockname ks-rel) *ks-cache*))
|
||||
)
|
||||
)
|
||||
(dbgreturn result)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEIL 5: PUNKTE-AUSWAHL MIT Z-HÖHE (HIER EINFÜGEN!)
|
||||
;; ============================================================
|
||||
@@ -258,6 +313,7 @@
|
||||
(dbgreturn t)
|
||||
)
|
||||
(progn
|
||||
(setq *ks-cache* nil)
|
||||
(princ "\n Lade Blockdefinitionen aus Bibliothek...")
|
||||
|
||||
(if (findfile koordinaten-lib)
|
||||
|
||||
+2
-2
@@ -25,10 +25,10 @@
|
||||
(dbgopen "debugfile.dbg" "DXFM_LOG") ; Debug-Datei im Log-Verzeichnis oeffnen
|
||||
(load (strcat base-path "ssg_dialog.lsp") "ssg_dialog.lsp nicht gefunden")
|
||||
(load (strcat base-path "ssg_layer.lsp") "ssg_layer.lsp nicht gefunden")
|
||||
(load (strcat base-path "KreiselInsert.lsp") "KreiselInsert.lsp nicht gefunden")
|
||||
;; KreiselInsert.lsp entfernt - ersetzt durch Python/PyRx (lib/elemente/kreisel.py, eckrad.py)
|
||||
(load (strcat base-path "VarioFoerderer.lsp") "VarioFoerderer.lsp nicht gefunden")
|
||||
(load (strcat base-path "tests.lsp") "tests.lsp nicht gefunden")
|
||||
(load (strcat base-path "OmniModulInsert.lsp") "OmniModulInsert.lsp nicht gefunden")
|
||||
;; OmniModulInsert.lsp entfernt - ersetzt durch Python/PyRx (lib/elemente/omniflo*.py)
|
||||
(load (strcat base-path "SSG_LIB_Commands.lsp") "SSG_LIB_Commands.lsp nicht gefunden")
|
||||
(prompt "\nSSG-Bibliotheken geladen: ssg_core, ssg_dbg, ssg_dialog, ssg_layer")
|
||||
(princ)
|
||||
|
||||
+438
@@ -202,3 +202,441 @@
|
||||
(defun c:EXPORTCSV ()
|
||||
(csv:run-export "EXPORTCSV" "export_csv.py" "export.csv")
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEST_FOERDERER - Automatischer Test ohne Benutzereingabe
|
||||
;; Erzeugt 12 Variofoerderer (6x Auf, 6x Ab) mit deltaL=7000
|
||||
;; und verschiedenen Hoehenstufen. Tabellarische Zusammenfassung.
|
||||
;; ============================================================
|
||||
(defun c:TEST_FOERDERER ( / deltaL deltaH richtung ergebnis
|
||||
best-winkel L_GF L_VF dateiname
|
||||
y-offset hoehen-liste idx
|
||||
anz-gebaut anz-nicht-gebaut
|
||||
result-pfad erfolgsquote
|
||||
zusammenfassung-liste
|
||||
nr deltaH_val status winkel L_GF_val L_VF_val)
|
||||
|
||||
;; Bibliothek initialisieren (laedt Block-Library und extrahiert Masse)
|
||||
(if (not *lib-initialized*)
|
||||
(init-bibliothek)
|
||||
)
|
||||
|
||||
(ssg-start "TEST_FOERDERER" '(("OSMODE") ("CECOLOR") ("ATTREQ") ("ATTDIA")))
|
||||
(setvar "OSMODE" 0)
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
|
||||
(setq deltaL 7000)
|
||||
(setq hoehen-liste '(0 1000 2000 3000 4000 5000))
|
||||
(setq y-offset 0)
|
||||
(setq idx 0)
|
||||
(setq zusammenfassung-liste '())
|
||||
(setq anz-gebaut 0)
|
||||
(setq anz-nicht-gebaut 0)
|
||||
|
||||
(princ "\n")
|
||||
(princ "\n================================================================")
|
||||
(princ "\n FOERDERTEST - PRODUKTIONSPROTOKOLL")
|
||||
(princ "\n================================================================")
|
||||
(princ (strcat "\n Distanz dL = " (rtos deltaL 2 0) " mm"))
|
||||
(princ "\n Hoehenstufen: 0, 1000, 2000, 3000, 4000, 5000 mm")
|
||||
(princ "\n Richtungen: Auf + Ab")
|
||||
(princ "\n================================================================")
|
||||
(princ "\n Nr. Richtung dH (mm) Status Winkel L_GF (mm) L_VF (mm)")
|
||||
(princ "\n================================================================")
|
||||
|
||||
;; ==========================================================
|
||||
;; TEIL 1: Aufwaerts-Tests (6 Foerderer)
|
||||
;; ==========================================================
|
||||
(foreach deltaH hoehen-liste
|
||||
(setq idx (1+ idx))
|
||||
(setq richtung "Auf")
|
||||
|
||||
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
||||
(setq best-winkel (car ergebnis))
|
||||
(setq L_GF (cadr ergebnis))
|
||||
(setq L_VF (caddr ergebnis))
|
||||
|
||||
(if (and best-winkel L_GF L_VF (> L_GF 0) (> L_VF 0))
|
||||
(progn
|
||||
(setq anz-gebaut (1+ anz-gebaut))
|
||||
(princ (strcat "\n "
|
||||
(itoa idx) " "
|
||||
(if (< idx 10) " " "")
|
||||
"Auf "
|
||||
(rtos deltaH 4 0) " "
|
||||
"GEBAUT "
|
||||
(itoa best-winkel) " Grad "
|
||||
(rtos L_GF 2 1) " "
|
||||
(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 zusammenfassung-liste (cons
|
||||
(list idx richtung deltaH "GEBAUT" best-winkel L_GF L_VF)
|
||||
zusammenfassung-liste))
|
||||
)
|
||||
(progn
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n "
|
||||
(itoa idx) " "
|
||||
(if (< idx 10) " " "")
|
||||
"Auf "
|
||||
(rtos deltaH 4 0) " "
|
||||
"NICHT "
|
||||
"--- "
|
||||
"--- "
|
||||
"---"))
|
||||
|
||||
(cond
|
||||
((and (<= L_GF 0) (<= L_VF 0))
|
||||
(princ "\n -> Grund: L_GF und L_VF sind negativ (Strecke zu kurz)"))
|
||||
((<= L_GF 0)
|
||||
(princ "\n -> Grund: L_GF ist negativ (Gefaellestrecke zu kurz)"))
|
||||
((<= L_VF 0)
|
||||
(princ "\n -> Grund: L_VF ist negativ (keine passende Steigung moeglich)"))
|
||||
((null best-winkel)
|
||||
(princ "\n -> Grund: Kein passender Winkel (Hoehendifferenz zu gross/klein)"))
|
||||
(t
|
||||
(princ "\n -> Grund: Unbekannter Fehler in der Berechnung"))
|
||||
)
|
||||
|
||||
(setq zusammenfassung-liste (cons
|
||||
(list idx richtung deltaH "NICHT_GEBAUT" nil nil nil)
|
||||
zusammenfassung-liste))
|
||||
)
|
||||
)
|
||||
(setq y-offset (- y-offset 200))
|
||||
)
|
||||
|
||||
;; ==========================================================
|
||||
;; TEIL 2: Abwaerts-Tests (6 Foerderer)
|
||||
;; ==========================================================
|
||||
(foreach deltaH hoehen-liste
|
||||
(setq idx (1+ idx))
|
||||
(setq richtung "Ab")
|
||||
|
||||
(if (< deltaH 1)
|
||||
(progn
|
||||
;; deltaH = 0 bei Abwaerts ist prinzipiell unmoeglich
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n "
|
||||
(itoa idx) " "
|
||||
(if (< idx 10) " " "")
|
||||
"Ab "
|
||||
(rtos deltaH 4 0) " "
|
||||
"NICHT "
|
||||
"--- "
|
||||
"--- "
|
||||
"---"))
|
||||
(princ "\n -> Grund: Bei Richtung 'Ab' mit dH=0 ist aus geometrischen Gruenden")
|
||||
(princ "\n keine Foerderanlage moeglich (immer negative Netto-Hoehe)")
|
||||
|
||||
(setq zusammenfassung-liste (cons
|
||||
(list idx richtung deltaH "GEOMETRISCH_UNMOEGLICH" nil nil nil)
|
||||
zusammenfassung-liste))
|
||||
)
|
||||
(progn
|
||||
(setq ergebnis (berechne-alle-winkel deltaL deltaH richtung))
|
||||
(setq best-winkel (car ergebnis))
|
||||
(setq L_GF (cadr ergebnis))
|
||||
(setq L_VF (caddr ergebnis))
|
||||
|
||||
(if (and best-winkel L_GF L_VF (> L_GF 0) (> L_VF 0))
|
||||
(progn
|
||||
(setq anz-gebaut (1+ anz-gebaut))
|
||||
(princ (strcat "\n "
|
||||
(itoa idx) " "
|
||||
(if (< idx 10) " " "")
|
||||
"Ab "
|
||||
(rtos deltaH 4 0) " "
|
||||
"GEBAUT "
|
||||
(itoa best-winkel) " Grad "
|
||||
(rtos L_GF 2 1) " "
|
||||
(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 zusammenfassung-liste (cons
|
||||
(list idx richtung deltaH "GEBAUT" best-winkel L_GF L_VF)
|
||||
zusammenfassung-liste))
|
||||
)
|
||||
(progn
|
||||
(setq anz-nicht-gebaut (1+ anz-nicht-gebaut))
|
||||
(princ (strcat "\n "
|
||||
(itoa idx) " "
|
||||
(if (< idx 10) " " "")
|
||||
"Ab "
|
||||
(rtos deltaH 4 0) " "
|
||||
"NICHT "
|
||||
"--- "
|
||||
"--- "
|
||||
"---"))
|
||||
|
||||
(cond
|
||||
((and (<= L_GF 0) (<= L_VF 0))
|
||||
(princ "\n -> Grund: L_GF und L_VF sind negativ (Strecke zu kurz)"))
|
||||
((<= L_GF 0)
|
||||
(princ "\n -> Grund: L_GF ist negativ (Gefaellestrecke zu kurz)"))
|
||||
((<= L_VF 0)
|
||||
(princ "\n -> Grund: L_VF ist negativ (Hoehendifferenz zu klein fuer diesen Weg)"))
|
||||
((null best-winkel)
|
||||
(princ "\n -> Grund: Kein passender Winkel (Hoehendifferenz zu gross)"))
|
||||
(t
|
||||
(princ "\n -> Grund: Unbekannter Fehler in der Berechnung"))
|
||||
)
|
||||
|
||||
(setq zusammenfassung-liste (cons
|
||||
(list idx richtung deltaH "NICHT_GEBAUT" nil nil nil)
|
||||
zusammenfassung-liste))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(setq y-offset (- y-offset 200))
|
||||
)
|
||||
|
||||
;; ==========================================================
|
||||
;; TEIL 3: ZUSAMMENFASSUNG
|
||||
;; ==========================================================
|
||||
(princ "\n\n================================================================================")
|
||||
(princ "\n ZUSAMMENFASSUNG")
|
||||
(princ (strcat "\n dL = " (rtos deltaL 2 0) " mm"))
|
||||
(princ "\n================================================================================")
|
||||
|
||||
(foreach item (reverse zusammenfassung-liste)
|
||||
(setq nr (car item))
|
||||
(setq richtung (cadr item))
|
||||
(setq deltaH_val (caddr item))
|
||||
(setq status (cadddr item))
|
||||
(setq winkel (car (cddddr item)))
|
||||
(setq L_GF_val (cadr (cddddr item)))
|
||||
(setq L_VF_val (caddr (cddddr item)))
|
||||
|
||||
(cond
|
||||
((= status "GEBAUT")
|
||||
(princ (strcat "\n "
|
||||
(itoa nr) ". " richtung
|
||||
(if (= richtung "Auf") " " " ")
|
||||
(rtos deltaH_val 2 0) " mm "
|
||||
(itoa winkel) " Grad "
|
||||
(rtos L_GF_val 2 2) " mm "
|
||||
(rtos L_VF_val 2 2) " mm GEBAUT")))
|
||||
((= status "GEOMETRISCH_UNMOEGLICH")
|
||||
(princ (strcat "\n "
|
||||
(itoa nr) ". " richtung
|
||||
(if (= richtung "Auf") " " " ")
|
||||
(rtos deltaH_val 2 0) " mm "
|
||||
"--- "
|
||||
"--- mm "
|
||||
"--- mm GEOMETRISCH UNMOEGLICH")))
|
||||
(t
|
||||
(princ (strcat "\n "
|
||||
(itoa nr) ". " richtung
|
||||
(if (= richtung "Auf") " " " ")
|
||||
(rtos deltaH_val 2 0) " mm "
|
||||
"--- "
|
||||
"--- mm "
|
||||
"--- mm NICHT GEBAUT")))
|
||||
)
|
||||
)
|
||||
|
||||
(princ "\n\n================================================================================")
|
||||
(princ (strcat "\n Erfolgreich gebaut: " (itoa anz-gebaut) " von " (itoa idx)))
|
||||
(princ (strcat "\n Erfolgsquote: " (rtos (/ (* anz-gebaut 100.0) idx) 2 1) "%"))
|
||||
(princ "\n================================================================================")
|
||||
|
||||
(princ "\n\n Erklaerung:")
|
||||
(princ "\n ----------")
|
||||
(princ "\n GEBAUT:")
|
||||
(princ "\n - Auf, dH=0 -> L_VF > 0 kompensiert 3 Grad-Gefaellestrecken")
|
||||
(princ "\n - Auf, dH>0 -> Normalfall")
|
||||
(princ "\n - Ab, dH>=1000 -> Normalfall")
|
||||
(princ "\n")
|
||||
(princ "\n NICHT GEBAUT:")
|
||||
(princ "\n - Ab, dH=0 -> Geometrisch unmoeglich (Netto-Hoehe immer negativ)")
|
||||
(princ "\n - Auf, dH=5000 -> 48 Grad Steigung reicht nicht aus (L_VF negativ)")
|
||||
(princ "\n - Ab, dH=5000 -> 48 Grad Gefaelle reicht nicht aus")
|
||||
(princ "\n================================================================================")
|
||||
|
||||
(ssg-end)
|
||||
|
||||
;; Datei speichern
|
||||
(if (getenv "DXFM_RESULTS")
|
||||
(setq result-pfad (getenv "DXFM_RESULTS"))
|
||||
(setq result-pfad (strcat (getenv "DXFM_BLOCKS") "/../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)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; TEST_KSEINAUS - KS_EIN/KS_AUS Ausrichtungstest
|
||||
;;
|
||||
;; Fuegt alle Vario-Bloecke in 3 Gruppen ein, jeweils 2 Reihen:
|
||||
;; Gruppe 1: Stationaere Elemente (AUS, EIN, Separator, Umlenk, Motor)
|
||||
;; Gruppe 2: Alle Boegen aufwaerts (in Z verschoben)
|
||||
;; Gruppe 3: Alle Boegen abwaerts (in Z verschoben)
|
||||
;;
|
||||
;; Pro Gruppe:
|
||||
;; Reihe A: nach KS_EIN ausgerichtet (KS_EIN X/Y = Referenz-X/Y)
|
||||
;; Reihe B: nach KS_AUS ausgerichtet (KS_AUS X/Y = Referenz-X/Y)
|
||||
;; Luecke von 400mm zwischen den Reihen
|
||||
;; ============================================================
|
||||
|
||||
;; Hilfsfunktion: Eine Liste von Bloecken in 2 Reihen aufreihen
|
||||
;; x-start: X-Position der Gruppe
|
||||
;; y-start: Y-Startposition (wird zurueckgegeben als naechster freier Y)
|
||||
;; z-offset: Z-Verschiebung (fuer Boegen)
|
||||
;; Rueckgabe: naechste freie Y-Position
|
||||
(defun ks-test-reihe (namen x-start y-start z-offset y-abstand y-luecke /
|
||||
bname block-obj ks-data ks-ein ks-aus
|
||||
insert-pt offset-vec y-pos idx)
|
||||
|
||||
;; --- Reihe A: nach KS_EIN ---
|
||||
(princ "\n Reihe KS_EIN:")
|
||||
(setq y-pos y-start)
|
||||
(setq idx 0)
|
||||
|
||||
(foreach bname namen
|
||||
(setq idx (1+ idx))
|
||||
(setq insert-pt (list x-start y-pos z-offset))
|
||||
(setq block-obj (vla-InsertBlock modelspace
|
||||
(vlax-3D-point insert-pt)
|
||||
bname 1.0 1.0 1.0 0))
|
||||
(setq ks-data (extract-ks-from-block block-obj))
|
||||
(setq ks-ein (cadr (assoc "KS_EIN" ks-data)))
|
||||
|
||||
(if ks-ein
|
||||
(progn
|
||||
(setq offset-vec (list (- x-start (car (car ks-ein)))
|
||||
(- y-pos (cadr (car ks-ein)))
|
||||
(- z-offset (caddr (car ks-ein)))))
|
||||
(vla-Move block-obj
|
||||
(vlax-3D-point '(0 0 0))
|
||||
(vlax-3D-point offset-vec))
|
||||
(princ (strcat "\n " (itoa idx) ". " bname " OK"))
|
||||
)
|
||||
(princ (strcat "\n " (itoa idx) ". " bname " WARNUNG: KS_EIN fehlt!"))
|
||||
)
|
||||
(setq y-pos (- y-pos y-abstand))
|
||||
)
|
||||
|
||||
;; --- Luecke ---
|
||||
(setq y-pos (- y-pos y-luecke))
|
||||
|
||||
;; --- Reihe B: nach KS_AUS ---
|
||||
(princ "\n Reihe KS_AUS:")
|
||||
(setq idx 0)
|
||||
|
||||
(foreach bname namen
|
||||
(setq idx (1+ idx))
|
||||
(setq insert-pt (list x-start y-pos z-offset))
|
||||
(setq block-obj (vla-InsertBlock modelspace
|
||||
(vlax-3D-point insert-pt)
|
||||
bname 1.0 1.0 1.0 0))
|
||||
(setq ks-data (extract-ks-from-block block-obj))
|
||||
(setq ks-aus (cadr (assoc "KS_AUS" ks-data)))
|
||||
|
||||
(if ks-aus
|
||||
(progn
|
||||
(setq offset-vec (list (- x-start (car (car ks-aus)))
|
||||
(- y-pos (cadr (car ks-aus)))
|
||||
(- z-offset (caddr (car ks-aus)))))
|
||||
(vla-Move block-obj
|
||||
(vlax-3D-point '(0 0 0))
|
||||
(vlax-3D-point offset-vec))
|
||||
(princ (strcat "\n " (itoa idx) ". " bname " OK"))
|
||||
)
|
||||
(princ (strcat "\n " (itoa idx) ". " bname " WARNUNG: KS_AUS fehlt!"))
|
||||
)
|
||||
(setq y-pos (- y-pos y-abstand))
|
||||
)
|
||||
|
||||
;; Naechste freie Y-Position zurueckgeben
|
||||
y-pos
|
||||
)
|
||||
|
||||
(defun c:TEST_KSEINAUS ( / stationen boegen-auf-liste boegen-ab-liste
|
||||
bname y-pos y-abstand y-luecke z-bogen)
|
||||
|
||||
;; Bibliothek initialisieren
|
||||
(if (not *lib-initialized*)
|
||||
(init-bibliothek)
|
||||
)
|
||||
|
||||
(ssg-start "TEST_KSEINAUS" '(("OSMODE") ("CECOLOR") ("ATTREQ") ("ATTDIA")))
|
||||
(setvar "OSMODE" 0)
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
|
||||
(setq y-abstand 200)
|
||||
(setq y-luecke 400)
|
||||
(setq z-bogen 2500)
|
||||
|
||||
;; Gruppe 1: Stationaere Elemente
|
||||
(setq stationen (list
|
||||
"_3D_AS_90_links"
|
||||
"Staustrecke_Separator_SP_300_mm"
|
||||
"Vario_Umlenkstation_500mm"
|
||||
"Vario_Motorstation_500mm"
|
||||
"_3D_ES_90_links"
|
||||
))
|
||||
|
||||
;; Gruppe 2+3: Boegen sammeln
|
||||
(setq boegen-auf-liste '())
|
||||
(setq boegen-ab-liste '())
|
||||
(foreach w '(3 6 9 12 15 18 21 27 33 39 45 51)
|
||||
(setq bname (strcat "Vario_Bogen_auf_" (itoa w) grad-zeichen))
|
||||
(if (tblsearch "BLOCK" bname)
|
||||
(setq boegen-auf-liste (append boegen-auf-liste (list bname)))
|
||||
)
|
||||
(setq bname (strcat "Vario_Bogen_ab_" (itoa w) grad-zeichen))
|
||||
(if (tblsearch "BLOCK" bname)
|
||||
(setq boegen-ab-liste (append boegen-ab-liste (list bname)))
|
||||
)
|
||||
)
|
||||
|
||||
(princ "\n================================================================")
|
||||
(princ "\n TEST_KSEINAUS - KS-Ausrichtungstest")
|
||||
(princ (strcat "\n Stationen: " (itoa (length stationen))))
|
||||
(princ (strcat "\n Boegen auf: " (itoa (length boegen-auf-liste))))
|
||||
(princ (strcat "\n Boegen ab: " (itoa (length boegen-ab-liste))))
|
||||
(princ (strcat "\n Z-Offset Boegen: " (rtos z-bogen 2 0) " mm"))
|
||||
(princ "\n================================================================")
|
||||
|
||||
;; Gruppe 1: Stationaere Elemente bei X=0, Z=0
|
||||
(princ "\n\n GRUPPE 1: Stationaere Elemente (Z=0)")
|
||||
(setq y-pos (ks-test-reihe stationen 0 0 0 y-abstand y-luecke))
|
||||
|
||||
;; Gruppe 2: Boegen aufwaerts bei X=3000, Z=z-bogen
|
||||
(princ "\n\n GRUPPE 2: Boegen aufwaerts (Z=" )
|
||||
(princ (strcat (rtos z-bogen 2 0) ")"))
|
||||
(setq y-pos (ks-test-reihe boegen-auf-liste 3000 0 z-bogen y-abstand y-luecke))
|
||||
|
||||
;; Gruppe 3: Boegen abwaerts bei X=6000, Z=z-bogen
|
||||
(princ "\n\n GRUPPE 3: Boegen abwaerts (Z=")
|
||||
(princ (strcat (rtos z-bogen 2 0) ")"))
|
||||
(setq y-pos (ks-test-reihe boegen-ab-liste 6000 0 z-bogen y-abstand y-luecke))
|
||||
|
||||
(ssg-end)
|
||||
|
||||
(princ "\n\n================================================================")
|
||||
(princ "\n TEST_KSEINAUS abgeschlossen")
|
||||
(princ "\n X=0: Stationen (KS_EIN + KS_AUS)")
|
||||
(princ "\n X=3000: Boegen auf (KS_EIN + KS_AUS)")
|
||||
(princ "\n X=6000: Boegen ab (KS_EIN + KS_AUS)")
|
||||
(princ "\n================================================================")
|
||||
(princ)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user