[CHANGE] Sivas Export schaut nun nur noch auf die kommaseparierte Liste im Attribut ARTINR und fügt die Artikelnummern in die Export-Liste ein; [ADD] Menü und dwg für Omniflo Ladeschleifen

This commit is contained in:
Simon Hensch
2026-09-28 13:53:46 +02:00
parent 5a13595289
commit dabf9e4f8a
18 changed files with 663 additions and 385 deletions
+144 -5
View File
@@ -964,6 +964,11 @@
)
(progn
(setq dxf-pfad (strcat omniflo-pfad "/" sivasnr-str ".dxf"))
;; Fallback: manche Elemente (z.B. Ladeschleifen) liegen nur als DWG vor
(if (and (not (findfile dxf-pfad))
(findfile (strcat omniflo-pfad "/" sivasnr-str ".dwg")))
(setq dxf-pfad (strcat omniflo-pfad "/" sivasnr-str ".dwg"))
)
(if (not (findfile dxf-pfad))
(progn
(princ (ssg-textf "omni-fehler-dxf-nicht-gefunden" (list dxf-pfad)))
@@ -1230,7 +1235,7 @@
typ eintrag winkel weichentyp
dlg-result new-eintrag new-hoehe new-drehung
basePoint sivasnr-str dxf-pfad data-pfad angleDeg blockEnt
layer-name)
layer-name such)
;; Implied Selection pruefen
(setq ss (ssget "I"))
@@ -1307,6 +1312,20 @@
)
)
;; Zuletzt in Ladeschleifen suchen (ARTINR, dann Blockname)
(if (null eintrag)
(progn
(if (null *OMNI-LADESCHLEIFEN*) (omni:load-ladeschleifen))
(foreach such (list artinr bname)
(if (and such (null eintrag))
(setq eintrag (omni:get-by-sivasid *OMNI-LADESCHLEIFEN*
(if (/= (atoi such) 0) (atoi such) such)))
)
)
(if eintrag (setq typ "ladeschleife"))
)
)
(if (null eintrag)
(progn
(ssg-emsg (ssg-text "omni-edit-kein-element"))
@@ -1317,12 +1336,15 @@
;; 4. Dialog oeffnen mit vorhandenen Werten
(setq dlg-result nil)
(if (= typ "bogen")
(progn
(cond
((= typ "bogen")
(setq winkel (cdr (assoc "KurvenWinkel" eintrag)))
(setq dlg-result (omni:bogen-dialog winkel hoehe drehung nil))
)
(progn
((= typ "ladeschleife")
(setq dlg-result (omni:ladeschleifen-dialog nil hoehe))
)
(T
(setq winkel (cdr (assoc "KurvenWinkel" eintrag)))
(setq weichentyp (cdr (assoc "WeichenTyp" eintrag)))
(setq dlg-result (omni:weichen-dialog winkel weichentyp hoehe drehung nil))
@@ -1343,8 +1365,12 @@
(setq new-drehung (rtos rotation 2 1))
(setq sivasnr-str (omni:sivasid-to-str (omni:val new-eintrag "Sivasnr")))
;; 6. DXF-Datei pruefen
;; 6. DXF-Datei pruefen (Fallback DWG wie in omni:insert-dxf)
(setq dxf-pfad (strcat (getenv "DXFM_OMNIFLO") "/" sivasnr-str ".dxf"))
(if (and (not (findfile dxf-pfad))
(findfile (strcat (getenv "DXFM_OMNIFLO") "/" sivasnr-str ".dwg")))
(setq dxf-pfad (strcat (getenv "DXFM_OMNIFLO") "/" sivasnr-str ".dwg"))
)
(if (not (findfile dxf-pfad))
(progn
(ssg-emsg (ssg-textf "omni-edit-dxf-nicht-gefunden" (list dxf-pfad)))
@@ -1446,6 +1472,119 @@
(princ)
)
;; --- Omniflo / Ladeschleifen ---
;; Datenbasis: data/json/omniflo_ladeschleifen.json. Die Beschreibungen
;; enthalten Kommas, daher der rekursive Parser ssg-json-laden statt des
;; zeilenbasierten ssg-load-json (siehe ssg_core.lsp).
;; Ladeschleifen-Daten laden (in *OMNI-LADESCHLEIFEN*)
(defun omni:load-ladeschleifen ( / data-pfad datei)
(setq data-pfad (getenv "DXFM_DATA"))
(if (null data-pfad)
(progn (princ (ssg-text "omni-fehler-dxfm-data")) nil)
(progn
(setq datei (strcat data-pfad "/json/omniflo_ladeschleifen.json"))
(setq *OMNI-LADESCHLEIFEN* (ssg-json-laden datei))
(if *OMNI-LADESCHLEIFEN*
(princ (strcat "\n[OMNI] " (itoa (length *OMNI-LADESCHLEIFEN*)) " Ladeschleifen geladen."))
(princ (strcat "\n[OMNI] WARNUNG: Keine Ladeschleifen geladen aus " datei))
)
*OMNI-LADESCHLEIFEN*
)
)
)
;; Zahl als Ganzzahl-String fuer die Dialoganzeige ("" wenn kein Zahlwert)
(defun omni:zahl-str (v)
(if (numberp v) (itoa (fix v)) "")
)
;; Detail-Felder im Ladeschleifen-Dialog aktualisieren (action_tile callback)
(defun omni:ladeschleife-dlg-update (idx-str / eintrag)
(setq eintrag (nth (atoi idx-str) *OMNI-DLG-LADESCHLEIFEN*))
(if eintrag
(progn
(set_tile "val_sivasnr" (omni:sivasid-to-str (omni:val eintrag "Sivasnr")))
(set_tile "val_profiltyp" (omni:sivasid-to-str (omni:val eintrag "ProfilTyp")))
(set_tile "val_laenge" (omni:zahl-str (omni:val eintrag "Laenge")))
)
)
)
;; Ladeschleifen-Auswahl-Dialog oeffnen
;; profiltyp = Praefix zum Filtern des ProfilTyp, z.B. "AP 110" (nil = alle)
;; init-hoehe = Vorbelegung Hoehe (nil = Default aus cfg)
;; Rueckgabe: (eintrag hoehe nil) wie omni:bogen-dialog, oder nil bei Abbruch
(defun omni:ladeschleifen-dialog (profiltyp init-hoehe / liste dat ergebnis dlg-hoehe profil)
(if (null *OMNI-LADESCHLEIFEN*) (omni:load-ladeschleifen))
(if (null init-hoehe) (setq init-hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
(setq liste *OMNI-LADESCHLEIFEN*)
(if profiltyp
(setq liste
(vl-remove-if-not
'(lambda (e)
(setq profil (cdr (assoc "ProfilTyp" e)))
(and (= (type profil) 'STR) (= (vl-string-search profiltyp profil) 0))
)
liste
)
)
)
(if (null liste)
(progn
(alert (ssg-textf "omni-ladeschleife-keine-gefunden"
(list (if profiltyp (strcat " (" profiltyp ")") ""))))
nil
)
(progn
(setq *OMNI-DLG-LADESCHLEIFEN* liste)
(setq dat (load_dialog (strcat (getenv "DXFM_DCL") "/omniflo_ladeschleifen.dcl")))
(if (not (new_dialog "omniflo_ladeschleifen" dat))
(progn (alert (ssg-text "omni-ladeschleife-dialog-ladefehler")) nil)
(progn
(start_list "ladeschleife")
(mapcar '(lambda (e) (add_list (omni:sivasid-to-str (omni:val e "Beschreibung")))) liste)
(end_list)
(set_tile "ladeschleife" "0")
(set_tile "val_hoehe" init-hoehe)
(omni:ladeschleife-dlg-update "0")
(action_tile "ladeschleife" "(omni:ladeschleife-dlg-update $value)")
(action_tile "accept"
(strcat
"(setq ergebnis (atoi (get_tile \"ladeschleife\")))"
"(setq dlg-hoehe (get_tile \"val_hoehe\"))"
"(done_dialog 1)"))
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(unload_dialog dat)
(if ergebnis
(list (nth ergebnis *OMNI-DLG-LADESCHLEIFEN*) dlg-hoehe nil)
)
)
)
)
)
)
(defun c:OMNI_LADESCHLEIFE_AP110 ( / dlg-result)
(setq dlg-result (omni:ladeschleifen-dialog "AP 110" nil))
(if dlg-result
(omni:insert-from-entry dlg-result)
(princ (ssg-text "omni-abbruch-ladeschleife"))
)
(princ)
)
;; --- Omniflo / Verbinder ---
(defun c:OMNI_TV_W_W ()
(princ "\n[DUMMY] TV W-W kpl")