Merge branch 'master' of https://gitea.schoenenberger.de/Schoenenberger_Systeme_GmbH/dxfmakros
This commit is contained in:
+10
-3
@@ -72,13 +72,13 @@
|
||||
|
||||
;; Attribut-Definitionen: ((TAG DEFAULT) ...)
|
||||
;; Anzeige-/Attributreihenfolge im Block (ID zuerst, dann Bezeichnung,
|
||||
;; Artinr. fest 6200, Montage-/Hoehendaten, dann Ausstattung).
|
||||
;; ARTINR fest 6200, Montage-/Hoehendaten, dann Ausstattung).
|
||||
;; NUMMER steht am Ende (wird intern fuer Nummerierung/Blockname
|
||||
;; benoetigt; Entfernen erfordert Refactor der Nummernvergabe).
|
||||
(setq *kreisel-attrib-defs*
|
||||
'(("ID" "")
|
||||
("Bezeichnung" "")
|
||||
("Artinr." "6200")
|
||||
("ARTINR" "6200")
|
||||
("MONTAGEHOEHE_m" "0.000")
|
||||
("HOEHE" "0")
|
||||
("KREISELART" "STANDARD")
|
||||
@@ -86,6 +86,7 @@
|
||||
("ANZAHL_SEPARATOR" "2")
|
||||
("ANZAHL_SCANNER" "0")
|
||||
("ANZAHL_RAMPEN" "0")
|
||||
("GERUEST_EINZELMODUL" "0")
|
||||
("DREHRICHTUNG" "UZS")
|
||||
("DREHUNG" "0")
|
||||
("NUMMER" "0"))
|
||||
@@ -867,7 +868,7 @@
|
||||
(defun c:KreiselEdit ( / sel ss ent ed attribs basePoint rotation
|
||||
dcl-pfad dat ergebnis
|
||||
dlg-name dlg-abstand dlg-hoehe dlg-ausrichtung
|
||||
dlg-drehrichtung dlg-kreiselart
|
||||
dlg-drehrichtung dlg-kreiselart dlg-geruest-einzelmodul
|
||||
newAbstand newRotation ausrichtLabels)
|
||||
|
||||
;; Implied Selection VOR ssg-start pruefen (ssg-start hebt Selektion auf)
|
||||
@@ -962,6 +963,9 @@
|
||||
(end_list)
|
||||
(set_tile "kreiselart" (if (equal (cdr (assoc "KREISELART" attribs)) "PIN") "1" "0"))
|
||||
|
||||
(set_tile "geruest_einzelmodul"
|
||||
(if (equal (cdr (assoc "GERUEST_EINZELMODUL" attribs)) "1") "1" "0"))
|
||||
|
||||
;; Actions
|
||||
(action_tile "accept"
|
||||
(strcat
|
||||
@@ -971,6 +975,7 @@
|
||||
"(setq dlg-ausrichtung (get_tile \"ausrichtung\"))"
|
||||
"(setq dlg-drehrichtung (get_tile \"drehrichtung\"))"
|
||||
"(setq dlg-kreiselart (get_tile \"kreiselart\"))"
|
||||
"(setq dlg-geruest-einzelmodul (get_tile \"geruest_einzelmodul\"))"
|
||||
"(done_dialog 1)"
|
||||
)
|
||||
)
|
||||
@@ -997,6 +1002,8 @@
|
||||
(setq attribs (subst (cons "DREHRICHTUNG"
|
||||
(if (= dlg-drehrichtung "1") "GUZ" "UZS"))
|
||||
(assoc "DREHRICHTUNG" attribs) attribs))
|
||||
(setq attribs (subst (cons "GERUEST_EINZELMODUL" dlg-geruest-einzelmodul)
|
||||
(assoc "GERUEST_EINZELMODUL" attribs) attribs))
|
||||
|
||||
;; Alten Block loeschen
|
||||
(command "_.ERASE" ent "")
|
||||
|
||||
+145
-98
@@ -332,12 +332,13 @@
|
||||
;; z.B. "APB 60" oder "APB 110" (nil = keine Einschraenkung)
|
||||
;; Rueckgabe: (eintrag hoehe drehung) oder nil bei Abbruch
|
||||
(defun omni:bogen-dialog (winkel init-hoehe init-drehung profiltyp / dcl-pfad dat boegen-liste
|
||||
profil-liste ergebnis dlg-hoehe dlg-drehung profil)
|
||||
profil-liste ergebnis dlg-hoehe profil)
|
||||
(if (null *OMNI-BOEGEN*) (omni:load-data))
|
||||
|
||||
;; Defaults
|
||||
;; Hinweis: init-drehung wird nicht mehr verwendet - die Drehung wird nach
|
||||
;; dem Einfuegen interaktiv abgefragt (omni:insert-dxf mit drehung=nil).
|
||||
(if (null init-hoehe) (setq init-hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(if (null init-drehung) (setq init-drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))
|
||||
|
||||
;; Boegen nach Winkel filtern
|
||||
(setq boegen-liste (omni:filter *OMNI-BOEGEN* "KurvenWinkel" winkel))
|
||||
@@ -388,9 +389,8 @@
|
||||
(end_list)
|
||||
(set_tile "bogenart" "0")
|
||||
|
||||
;; Hoehe und Drehung initialisieren
|
||||
;; Hoehe initialisieren (Drehung erfolgt interaktiv nach dem Einfuegen)
|
||||
(set_tile "val_hoehe" init-hoehe)
|
||||
(set_tile "val_drehung" init-drehung)
|
||||
|
||||
;; Startwerte anzeigen
|
||||
(omni:bogen-dlg-update "0")
|
||||
@@ -403,16 +403,15 @@
|
||||
(strcat
|
||||
"(setq ergebnis (atoi (get_tile \"bogenart\")))"
|
||||
"(setq dlg-hoehe (get_tile \"val_hoehe\"))"
|
||||
"(setq dlg-drehung (get_tile \"val_drehung\"))"
|
||||
"(done_dialog 1)"))
|
||||
(action_tile "cancel" "(done_dialog 0)")
|
||||
|
||||
(start_dialog)
|
||||
(unload_dialog dat)
|
||||
|
||||
;; Gewaehlten Eintrag mit Hoehe/Drehung zurueckgeben
|
||||
;; Gewaehlten Eintrag mit Hoehe zurueckgeben (drehung=nil -> interaktiv)
|
||||
(if ergebnis
|
||||
(list (nth ergebnis *OMNI-DLG-BOEGEN*) dlg-hoehe dlg-drehung)
|
||||
(list (nth ergebnis *OMNI-DLG-BOEGEN*) dlg-hoehe nil)
|
||||
nil
|
||||
)
|
||||
)
|
||||
@@ -766,13 +765,14 @@
|
||||
;; weichentyp = "Einzelweiche", "Doppelweiche", "Dreiwegeweiche" oder nil fuer alle
|
||||
;; init-hoehe / init-drehung = Vorbelegung (optional, fuer Edit-Modus)
|
||||
;; Rueckgabe: (eintrag hoehe drehung) oder nil bei Abbruch
|
||||
(defun omni:weichen-dialog (winkel weichentyp init-hoehe init-drehung / dcl-pfad dat basis-liste
|
||||
profil-liste ergebnis dlg-hoehe dlg-drehung)
|
||||
(defun omni:weichen-dialog (winkel weichentyp init-hoehe init-drehung breite / dcl-pfad dat basis-liste
|
||||
profil-liste ergebnis dlg-hoehe)
|
||||
(if (null *OMNI-WEICHEN*) (omni:load-data))
|
||||
|
||||
;; Defaults
|
||||
;; Hinweis: init-drehung wird nicht mehr verwendet - die Drehung wird nach
|
||||
;; dem Einfuegen interaktiv abgefragt (omni:insert-dxf mit drehung=nil).
|
||||
(if (null init-hoehe) (setq init-hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(if (null init-drehung) (setq init-drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))
|
||||
|
||||
;; Weichen nach Winkel filtern (nil = alle Winkel)
|
||||
(if winkel
|
||||
@@ -788,6 +788,14 @@
|
||||
basis-liste))
|
||||
)
|
||||
|
||||
;; Optional nach Breite filtern (z.B. Weichenkombinationen Delta 1400/700 vs. 1600/800)
|
||||
(if breite
|
||||
(setq basis-liste
|
||||
(vl-remove-if-not
|
||||
'(lambda (e) (= (cdr (assoc "Breite" e)) breite))
|
||||
basis-liste))
|
||||
)
|
||||
|
||||
(if (null basis-liste)
|
||||
(progn
|
||||
(alert (ssg-textf "omni-weiche-keine-gefunden"
|
||||
@@ -823,9 +831,8 @@
|
||||
(end_list)
|
||||
(set_tile "profiltyp" "0")
|
||||
|
||||
;; Hoehe und Drehung initialisieren
|
||||
;; Hoehe initialisieren (Drehung erfolgt interaktiv nach dem Einfuegen)
|
||||
(set_tile "val_hoehe" init-hoehe)
|
||||
(set_tile "val_drehung" init-drehung)
|
||||
|
||||
;; Startwerte anzeigen
|
||||
(omni:weichen-dlg-update "0")
|
||||
@@ -846,16 +853,15 @@
|
||||
(strcat
|
||||
"(setq ergebnis (atoi (get_tile \"profiltyp\")))"
|
||||
"(setq dlg-hoehe (get_tile \"val_hoehe\"))"
|
||||
"(setq dlg-drehung (get_tile \"val_drehung\"))"
|
||||
"(done_dialog 1)"))
|
||||
(action_tile "cancel" "(done_dialog 0)")
|
||||
|
||||
(start_dialog)
|
||||
(unload_dialog dat)
|
||||
|
||||
;; Gewaehlten Eintrag mit Hoehe/Drehung zurueckgeben
|
||||
;; Gewaehlten Eintrag mit Hoehe zurueckgeben (drehung=nil -> interaktiv)
|
||||
(if ergebnis
|
||||
(list (nth ergebnis *OMNI-DLG-WEICHEN*) dlg-hoehe dlg-drehung)
|
||||
(list (nth ergebnis *OMNI-DLG-WEICHEN*) dlg-hoehe nil)
|
||||
nil
|
||||
)
|
||||
)
|
||||
@@ -876,7 +882,8 @@
|
||||
;; hoehe = Hoehe in mm als String (wird als HOEHE-Attribut gesetzt)
|
||||
;; drehung = Drehwinkel in Grad als String (Block-Rotation)
|
||||
;; Rueckgabe: Einfuegepunkt oder nil bei Abbruch
|
||||
(defun omni:insert-dxf (sivasnr-str hoehe drehung / dxf-pfad omniflo-pfad pt angleDeg winkel-rad drehung-anzeige blockEnt attribs layer-name)
|
||||
(defun omni:insert-dxf (sivasnr-str hoehe drehung / dxf-pfad omniflo-pfad angleDeg
|
||||
drehung-anzeige blockEnt attribs layer-name ed pt10 zval zdelta)
|
||||
(setq omniflo-pfad (getenv "DXFM_OMNIFLO"))
|
||||
(if (null omniflo-pfad)
|
||||
(progn
|
||||
@@ -891,81 +898,94 @@
|
||||
nil
|
||||
)
|
||||
(progn
|
||||
(setq pt (getpoint (ssg-text "omni-prompt-einfuegepunkt")))
|
||||
(if (null pt)
|
||||
(progn (princ (ssg-text "omni-abbruch-omni")) nil)
|
||||
(progn
|
||||
(ssg-start "OMNI DXF Insert" '(("OSMODE") ("ATTREQ") ("ATTDIA")))
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
(ssg-start "OMNI DXF Insert" '(("ATTREQ") ("ATTDIA")))
|
||||
(setvar "ATTREQ" 0)
|
||||
(setvar "ATTDIA" 0)
|
||||
|
||||
;; Drehwinkel aus Dialog uebernehmen, sonst interaktiv am Einfuegepunkt abfragen
|
||||
(if drehung
|
||||
;; Absolute Z-Hoehe fuer den Einfuegepunkt bestimmen
|
||||
(setq zval (if (and hoehe (/= hoehe "")) (atof hoehe) 0.0))
|
||||
|
||||
;; Interaktives Einfuegen mit Live-Vorschau am Mauszeiger:
|
||||
;; dxf-pfad -> Block aus Datei definieren/waehlen
|
||||
;; 1. 'pause -> Einfuegepunkt; Objekt haengt sichtbar am Cursor und
|
||||
;; verschiebt sich mit der Maus (erster Klick positioniert)
|
||||
;; "" "" -> X-/Y-Massstab = 1
|
||||
;; Drehung -> aus Dialog fest, sonst 2. 'pause: Objekt dreht sich
|
||||
;; beim Ziehen sichtbar mit, zweiter Klick beendet
|
||||
(if drehung
|
||||
(progn
|
||||
(setq angleDeg (atof drehung))
|
||||
(setq drehung-anzeige drehung)
|
||||
(command "_.INSERT" dxf-pfad pause "" "" angleDeg)
|
||||
)
|
||||
(command "_.INSERT" dxf-pfad pause "" "" pause)
|
||||
)
|
||||
;; INSERT vollstaendig abschliessen (bei Bedarf weitere Eingabe zulassen)
|
||||
(while (> (getvar "CMDACTIVE") 0) (command pause))
|
||||
|
||||
(setq blockEnt (entlast))
|
||||
|
||||
(if (and blockEnt (= (cdr (assoc 0 (entget blockEnt))) "INSERT"))
|
||||
(progn
|
||||
(setq ed (entget blockEnt))
|
||||
|
||||
;; Tatsaechlich per Maus gesetzte Drehung ermitteln (interaktiv)
|
||||
(if (null drehung)
|
||||
(progn
|
||||
(setq angleDeg (atof drehung))
|
||||
(setq drehung-anzeige drehung)
|
||||
)
|
||||
(progn
|
||||
(setq winkel-rad (getangle pt (ssg-text "omni-prompt-drehwinkel")))
|
||||
(setq angleDeg (if winkel-rad (* winkel-rad (/ 180.0 pi)) 0.0))
|
||||
(setq angleDeg (* (cdr (assoc 50 ed)) (/ 180.0 pi)))
|
||||
(setq drehung-anzeige (rtos angleDeg 2 1))
|
||||
)
|
||||
)
|
||||
|
||||
;; Hoehe als Z-Koordinate auf den Einfuegepunkt anwenden
|
||||
(if (and hoehe (/= hoehe ""))
|
||||
(setq pt (list (car pt) (cadr pt) (atof hoehe)))
|
||||
(setq pt (list (car pt) (cadr pt) (if (caddr pt) (caddr pt) 0.0)))
|
||||
;; Z-Hoehe absolut anwenden: Block (inkl. Attribute) per MOVE um
|
||||
;; die Differenz zum aktuellen Einfuegepunkt-Z verschieben. Osnap
|
||||
;; beim interaktiven Einfuegen kann eine abweichende Z-Lage liefern,
|
||||
;; daher Differenz statt fixem Wert (vgl. GF-Z-Versatz-Bug).
|
||||
;; Explizite Koordinaten unterliegen keinem Objektfang.
|
||||
(setq pt10 (cdr (assoc 10 ed)))
|
||||
(setq zdelta (- zval (caddr pt10)))
|
||||
(if (/= zdelta 0.0)
|
||||
(command "_.MOVE" blockEnt "" (list 0.0 0.0 0.0) (list 0.0 0.0 zdelta))
|
||||
)
|
||||
|
||||
;; Objektfang aus: sonst kann _.INSERT den (mit expliziter Z-Hoehe
|
||||
;; gesetzten) Einfuegepunkt auf ein Objekt umfangen -> falsche Hoehe
|
||||
;; (gleicher Bugtyp wie beim GF-Z-Versatz). OSMODE via ssg-start
|
||||
;; gesichert, ssg-end stellt es wieder her.
|
||||
(setvar "OSMODE" 0)
|
||||
;; Block einfuegen mit Drehwinkel aus Dialog
|
||||
(command "_.INSERT" dxf-pfad pt "" "" angleDeg)
|
||||
;; INSERT vollstaendig abschliessen (Attribut-Prompts beenden)
|
||||
(while (> (getvar "CMDACTIVE") 0) (command ""))
|
||||
;; HOEHE und DREHUNG Attribute setzen
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" drehung-anzeige)))
|
||||
|
||||
(setq blockEnt (entlast))
|
||||
|
||||
(if (and blockEnt (= (cdr (assoc 0 (entget blockEnt))) "INSERT"))
|
||||
;; Layer aus LAYER-Attribut lesen und Block verschieben
|
||||
(setq attribs (ssg-attrib-read blockEnt))
|
||||
(setq layer-name (cdr (assoc "LAYER" attribs)))
|
||||
(if (and layer-name (> (strlen layer-name) 0))
|
||||
(progn
|
||||
;; HOEHE und DREHUNG Attribute setzen
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" drehung-anzeige)))
|
||||
|
||||
;; Layer aus LAYER-Attribut lesen und Block verschieben
|
||||
(setq attribs (ssg-attrib-read blockEnt))
|
||||
(setq layer-name (cdr (assoc "LAYER" attribs)))
|
||||
(if (and layer-name (> (strlen layer-name) 0))
|
||||
(progn
|
||||
(ssg-make-layer layer-name 7 nil)
|
||||
(entmod (subst (cons 8 layer-name) (assoc 8 (entget blockEnt)) (entget blockEnt)))
|
||||
(entupd blockEnt)
|
||||
)
|
||||
)
|
||||
(ssg-make-layer layer-name 7 nil)
|
||||
(entmod (subst (cons 8 layer-name) (assoc 8 (entget blockEnt)) (entget blockEnt)))
|
||||
(entupd blockEnt)
|
||||
)
|
||||
)
|
||||
|
||||
;; Eindeutige ID zuweisen
|
||||
(if (and blockEnt (atoms-family 1 '("ssg-id-generate")))
|
||||
(ssg-id-generate blockEnt)
|
||||
)
|
||||
|
||||
(princ (ssg-textf "omni-dxf-eingefuegt"
|
||||
(list
|
||||
sivasnr-str
|
||||
(if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000"))
|
||||
drehung-anzeige
|
||||
(if layer-name (strcat " Layer=" layer-name) "")
|
||||
)))
|
||||
(ssg-end)
|
||||
pt
|
||||
)
|
||||
)
|
||||
|
||||
;; Fallback fuer Anzeige, falls keine Drehung ermittelt wurde
|
||||
(if (null drehung-anzeige)
|
||||
(setq drehung-anzeige (rtos (if angleDeg angleDeg 0.0) 2 1))
|
||||
)
|
||||
|
||||
;; Eindeutige ID zuweisen
|
||||
(if (and blockEnt (atoms-family 1 '("ssg-id-generate")))
|
||||
(ssg-id-generate blockEnt)
|
||||
)
|
||||
|
||||
(princ (ssg-textf "omni-dxf-eingefuegt"
|
||||
(list
|
||||
sivasnr-str
|
||||
(if hoehe hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000"))
|
||||
drehung-anzeige
|
||||
(if layer-name (strcat " Layer=" layer-name) "")
|
||||
)))
|
||||
(ssg-end)
|
||||
;; Rueckgabe: tatsaechlicher Einfuegepunkt
|
||||
(if blockEnt (cdr (assoc 10 (entget blockEnt))))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -996,7 +1016,7 @@
|
||||
|
||||
;; --- Omniflo / Weiche 90 Grad ---
|
||||
(defun c:OMNI_W90_Einfach ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Einzelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Einzelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1005,7 +1025,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_W90_Doppel ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Doppelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Doppelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1014,7 +1034,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_W90_Dreiwege ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Dreiwegeweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 90 "Dreiwegeweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1024,7 +1044,7 @@
|
||||
|
||||
;; --- Omniflo / Weiche 45 Grad ---
|
||||
(defun c:OMNI_W45_Einfach ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Einzelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Einzelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1033,7 +1053,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_W45_Doppel ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Doppelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Doppelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1042,7 +1062,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_W45_Dreiwege ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Dreiwegeweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 45 "Dreiwegeweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1052,7 +1072,7 @@
|
||||
|
||||
;; --- Omniflo / Weichen Parallel ---
|
||||
(defun c:OMNI_WP_Einfach ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Einzelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Einzelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1061,7 +1081,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_WP_Doppel ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Doppelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Doppelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1070,7 +1090,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_WP_Dreiwege ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Dreiwegeweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 0 "Dreiwegeweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1080,7 +1100,7 @@
|
||||
|
||||
;; --- Omniflo / Weichenkoerper ---
|
||||
(defun c:OMNI_WK_Einfach ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Einzelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Einzelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1089,7 +1109,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_WK_Doppel ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Doppelweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Doppelweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1098,7 +1118,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_WK_Dreiwege ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Dreiwegeweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog 22.5 "Dreiwegeweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1107,8 +1127,17 @@
|
||||
)
|
||||
|
||||
;; --- Omniflo / Weichenkombinationen ---
|
||||
(defun c:OMNI_WKomb_Delta ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog nil "Deltaweiche" nil nil))
|
||||
(defun c:OMNI_WKomb_Delta_1400 ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog nil "Deltaweiche" nil nil 1400))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
)
|
||||
(princ)
|
||||
)
|
||||
|
||||
(defun c:OMNI_WKomb_Delta_1600 ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog nil "Deltaweiche" nil nil 1600))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1117,7 +1146,7 @@
|
||||
)
|
||||
|
||||
(defun c:OMNI_WKomb_Star ( / dlg-result)
|
||||
(setq dlg-result (omni:weichen-dialog nil "Sternweiche" nil nil))
|
||||
(setq dlg-result (omni:weichen-dialog nil "Sternweiche" nil nil nil))
|
||||
(if dlg-result
|
||||
(omni:insert-from-entry dlg-result)
|
||||
(princ (ssg-text "omni-abbruch-weiche"))
|
||||
@@ -1135,7 +1164,8 @@
|
||||
artinr hoehe drehung rotation
|
||||
typ eintrag winkel weichentyp
|
||||
dlg-result new-eintrag new-hoehe new-drehung
|
||||
basePoint sivasnr-str dxf-pfad data-pfad angleDeg blockEnt)
|
||||
basePoint sivasnr-str dxf-pfad data-pfad angleDeg blockEnt
|
||||
layer-name)
|
||||
|
||||
;; Implied Selection pruefen
|
||||
(setq ss (ssget "I"))
|
||||
@@ -1230,7 +1260,7 @@
|
||||
(progn
|
||||
(setq winkel (cdr (assoc "KurvenWinkel" eintrag)))
|
||||
(setq weichentyp (cdr (assoc "WeichenTyp" eintrag)))
|
||||
(setq dlg-result (omni:weichen-dialog winkel weichentyp hoehe drehung))
|
||||
(setq dlg-result (omni:weichen-dialog winkel weichentyp hoehe drehung nil))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1239,9 +1269,13 @@
|
||||
)
|
||||
|
||||
;; 5. Neuen Eintrag und Werte extrahieren
|
||||
;; Drehung: Dialog liefert keine Drehung mehr (interaktiv beim Neu-Einfuegen);
|
||||
;; beim Edit wird die bestehende Blockdrehung beibehalten. Quelle ist die
|
||||
;; tatsaechliche Geometrie (rotation = Gruppe 50 in Grad, immer numerisch),
|
||||
;; nicht das DREHUNG-Attribut (kann fehlen/kein Zahl-String sein -> (atof T)).
|
||||
(setq new-eintrag (car dlg-result))
|
||||
(setq new-hoehe (cadr dlg-result))
|
||||
(setq new-drehung (caddr dlg-result))
|
||||
(setq new-drehung (rtos rotation 2 1))
|
||||
(setq sivasnr-str (omni:sivasid-to-str (omni:val new-eintrag "Sivasnr")))
|
||||
|
||||
;; 6. DXF-Datei pruefen
|
||||
@@ -1272,9 +1306,22 @@
|
||||
|
||||
;; Attribute setzen
|
||||
(if (and blockEnt (= (cdr (assoc 0 (entget blockEnt))) "INSERT"))
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if new-hoehe new-hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" (if new-drehung new-drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))))
|
||||
(progn
|
||||
(ssg-attrib-set-on blockEnt
|
||||
(list (cons "HOEHE" (if new-hoehe new-hoehe (ssg-cfg-or "omniflo" "default_hoehe" "2000")))
|
||||
(cons "DREHUNG" (if new-drehung new-drehung (ssg-cfg-or "omniflo" "default_drehung" "0")))))
|
||||
|
||||
;; Layer aus LAYER-Attribut lesen und Block verschieben (wie omni:insert-dxf)
|
||||
(setq attribs (ssg-attrib-read blockEnt))
|
||||
(setq layer-name (cdr (assoc "LAYER" attribs)))
|
||||
(if (and layer-name (> (strlen layer-name) 0))
|
||||
(progn
|
||||
(ssg-make-layer layer-name 7 nil)
|
||||
(entmod (subst (cons 8 layer-name) (assoc 8 (entget blockEnt)) (entget blockEnt)))
|
||||
(entupd blockEnt)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(princ (ssg-textf "omni-edit-aktualisiert"
|
||||
|
||||
@@ -169,12 +169,6 @@
|
||||
(setq hz (* (atan dy dx) (/ 180.0 pi)))
|
||||
(setq winkel (* (atan (- dz) horiz) (/ 180.0 pi)))
|
||||
|
||||
;; Linie zwischen den beiden Punkten zeichnen
|
||||
(entmake (list '(0 . "LINE")
|
||||
(cons 8 (getvar "CLAYER"))
|
||||
(cons 10 p1)
|
||||
(cons 11 p2)))
|
||||
|
||||
;; Volle Elemente ab dem Startpunkt aneinanderreihen
|
||||
(setq anzahl-voll
|
||||
(fix (/ (+ laenge *tefl-toleranz*) *tefl-elementlaenge*)))
|
||||
|
||||
+2
-2
@@ -440,13 +440,13 @@
|
||||
;; (Gefaellestrecke + VarioFoerderer, feste Reihenfolge)
|
||||
;; ============================================================
|
||||
;; Vorderteil (immer vorhanden). Bezeichnung = Blockname (GF_n/VF_n),
|
||||
;; Artinr. fest 6220 (alle GF/VF). TYP-Wert wird zur Laufzeit gesetzt.
|
||||
;; ARTINR fest 6220 (alle GF/VF). TYP-Wert wird zur Laufzeit gesetzt.
|
||||
;; ID zuerst (global, jeder eingefuegte Baustein - Kreisel/GF/VF - erhaelt eine
|
||||
;; neue ID), danach Bezeichnung (= Blockname). Hoehen/Delta mit Einheit _mm.
|
||||
(setq *strecke-attr-front*
|
||||
'(("ID" "")
|
||||
("Bezeichnung" "")
|
||||
("Artinr." "6220")
|
||||
("ARTINR" "6220")
|
||||
("MONTAGEHOEHE_m" "0.000")
|
||||
("HOEHE_VON_mm" "0")
|
||||
("HOEHE_BIS_mm" "0")
|
||||
|
||||
+13
-5
@@ -1116,7 +1116,7 @@
|
||||
(ssg-attrib-set-on vf-insert
|
||||
(list
|
||||
(cons "Bezeichnung" vf-bname)
|
||||
;; Artinr. bleibt auf Schema-Vorgabe "6220"
|
||||
;; ARTINR bleibt auf Schema-Vorgabe "6220"
|
||||
(cons "MONTAGEHOEHE_m" (rtos montagehoehe-m 2 3))
|
||||
(cons "HOEHE_VON_mm" (itoa (fix hoehe-von)))
|
||||
(cons "HOEHE_BIS_mm" (itoa (fix hoehe-bis)))
|
||||
@@ -1195,7 +1195,7 @@
|
||||
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
|
||||
staustrecke-basis)
|
||||
staustrecke-basis vf-insert)
|
||||
|
||||
(princ "\n=========================================")
|
||||
(princ (ssg-text "vfc-banner-titel"))
|
||||
@@ -1439,9 +1439,17 @@
|
||||
(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_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz)
|
||||
(setq vf-insert
|
||||
(vf-block-erstellen anlage-typ seite vf-nummer n-scanner
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz))
|
||||
|
||||
;; Standard-Bloecke aus dem interaktiven Konsolen-Ablauf ebenfalls mit der
|
||||
;; SSG_VF_EDIT-XDATA markieren - sie sind (wie die Dialog-Variante) aus
|
||||
;; Attributen + hz verlustfrei rekonstruierbar, also per Doppelklick
|
||||
;; (c:VARIOFOERDERER_EDIT) editierbar. Etage/Linienzug bleiben unmarkiert.
|
||||
(if (and vf-insert (= anlage-typ "standard"))
|
||||
(vfs-xdata-schreiben vf-insert hz))
|
||||
|
||||
(princ "\n=========================================")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user