Merge Geruest-Feature mit 2D/3D-Umschaltung zusammengefuehrt
Konflikte in Gefaellestrecke.lsp und vf_standard.lsp aufgeloest - beide Features behalten. Dialog-Rueckgaben: dim vor den Geruest-Werten. Modus-1 (c:GEFAELLESTRECKE) und die Batch-Konverter (gf-/vf-konvertiere-ent) an die um Geruest-Parameter erweiterten Signaturen (gf-rebuild, gefaellestrecke-einfuegen, vf-block-erstellen) angepasst. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+71
-23
@@ -1311,7 +1311,9 @@
|
||||
|
||||
;; delta-l-gf bereits vor der Zusammenfassung berechnet
|
||||
|
||||
;; Block mit allen Attributen erstellen
|
||||
;; Block mit allen Attributen erstellen. Geruest fuer Einzelmodul/
|
||||
;; Geruestoption sind in diesem Linienzug-Ablauf (Modus 3, keine DCL-
|
||||
;; Eingabe) nicht abfragbar - bleiben auf Schema-Default.
|
||||
(gf-block-erstellen
|
||||
"gruppe" as-seite gf-nummer
|
||||
(caddr startpunkt)
|
||||
@@ -1326,7 +1328,7 @@
|
||||
bR90 bR60 bR30
|
||||
startpunkt last-ent nach-aus-pt entry-hz
|
||||
(caddr (nth first-idx segmente))
|
||||
es-seite)
|
||||
es-seite "0" "Schoenenberger Geruest")
|
||||
|
||||
(princ "\n\n=========================================")
|
||||
(princ (ssg-text "gf-status-fertig"))
|
||||
@@ -1425,9 +1427,11 @@
|
||||
bogen-L90 bogen-L60 bogen-L30
|
||||
bogen-R90 bogen-R60 bogen-R30
|
||||
startpunkt last-ent nach-aus-pt entry-hz L-first-seg
|
||||
es-seite /
|
||||
es-seite geruest-einzelmodul geruest-typ /
|
||||
gf-bname gf-ss ent gf-insert typ-str anzahl-gf
|
||||
gf-winkel-str i gf-g10z gf-korr-dz gf-osmode-alt)
|
||||
(if (null geruest-einzelmodul) (setq geruest-einzelmodul "0"))
|
||||
(if (null geruest-typ) (setq geruest-typ (ssg-geruest-idx-to-typ (ssg-geruest-typ-to-idx nil))))
|
||||
;; Beschriftung: Mitte der ersten Geraden, 400mm senkrecht versetzt
|
||||
(gf-make-label gf-nummer hoehe-von hoehe-bis deltaH deltaL
|
||||
L-gf-str winkel n-separator nach-aus-pt entry-hz L-first-seg)
|
||||
@@ -1511,6 +1515,8 @@
|
||||
(cons "GF_Bogen_R_30" (itoa bogen-R30))
|
||||
(cons "ANZAHL_SEPARATOR" (itoa n-separator))
|
||||
(cons "ANZAHL_SCANNER" (itoa n-scanner))
|
||||
(cons "GERUEST_EINZELMODUL" geruest-einzelmodul)
|
||||
(cons "GERUEST_TYP" geruest-typ)
|
||||
)
|
||||
)
|
||||
;; Aufsteigende, eindeutige ID vergeben (wie beim Kreisel), falls verfuegbar.
|
||||
@@ -1526,8 +1532,10 @@
|
||||
|
||||
;; deltaL-total: gesamte Horizontaldistanz (fuer DELTA_L-Attribut)
|
||||
;; hz: Fahrtrichtung in Grad (0=Ost, 90=Nord, 180=West, 270=Sued)
|
||||
;; geruest-einzelmodul/geruest-typ: an gf-block-erstellen durchgereicht (Attribute
|
||||
;; GERUEST_EINZELMODUL/GERUEST_TYP, siehe *ssg-geruest-optionen* in ssg_core.lsp)
|
||||
(defun gefaellestrecke-einfuegen (L_stau winkel startpunkt as-seite es-seite hz deltaL-total
|
||||
as-winkel es-winkel /
|
||||
as-winkel es-winkel geruest-einzelmodul geruest-typ /
|
||||
as-block es-block endpunkt
|
||||
gf-nummer last-ent rad-hz rad-v xu-incl
|
||||
ein-hz rad-ein xu-ein
|
||||
@@ -1627,7 +1635,7 @@
|
||||
1 0
|
||||
0 0 0 0 0 0
|
||||
startpunkt last-ent nach-aus-pt (float hz) (float L_stau)
|
||||
es-seite))
|
||||
es-seite geruest-einzelmodul geruest-typ))
|
||||
|
||||
;; Edit-Metadaten (Fahrtrichtung, Gefaellewinkel, Element-Winkel) als XDATA
|
||||
;; auf das GF_N-INSERT schreiben, damit GEFAELLESTRECKE_EDIT die Strecke
|
||||
@@ -1657,15 +1665,18 @@
|
||||
;; um die Angabe der Einfuegehoehe (Z).
|
||||
;; prefill: Assoziationsliste zur Vorbelegung (fuer GEFAELLESTRECKE_EDIT) mit
|
||||
;; Schluesseln "deltaL" "winkel" "hz" "as-seite" "es-seite" "einfuegehoehe"
|
||||
;; "as-winkel" "es-winkel" - oder nil fuer Neuanlage (Modus 1) mit Defaults.
|
||||
;; "as-winkel" "es-winkel" "geruest-einzelmodul" "geruest-typ" - oder nil
|
||||
;; fuer Neuanlage (Modus 1) mit Defaults.
|
||||
;; Rueckgabe: (deltaL winkel hz-winkel as-seite es-seite einfuegehoehe
|
||||
;; as-winkel es-winkel)
|
||||
;; as-winkel es-winkel geruest-einzelmodul geruest-typ)
|
||||
;; oder nil bei Abbruch / fehlendem Dialog.
|
||||
(defun gf-dialog-eingabe ( prefill hoehe-vorbelegung / dcl-pfad dat ergebnis
|
||||
dlg-deltal dlg-hoehe dlg-winkel
|
||||
dlg-richtung dlg-aus dlg-ein
|
||||
dlg-aus-winkel dlg-ein-winkel dlg-dim
|
||||
hz-winkel as-seite es-seite as-winkel es-winkel dim)
|
||||
dlg-geruest-einzelmodul dlg-geruest-typ
|
||||
hz-winkel as-seite es-seite as-winkel es-winkel dim
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq dcl-pfad (strcat (getenv "DXFM_DCL") "/gefaellestrecke.dcl"))
|
||||
(setq dat (load_dialog dcl-pfad))
|
||||
(if (not (new_dialog "gefaellestrecke" dat))
|
||||
@@ -1741,6 +1752,14 @@
|
||||
(set_tile "ein_seite"
|
||||
(if (and prefill (equal (cdr (assoc "es-seite" prefill)) "rechts")) "1" "0"))
|
||||
|
||||
(set_tile "geruest_einzelmodul"
|
||||
(if (and prefill (equal (cdr (assoc "geruest-einzelmodul" prefill)) "1")) "1" "0"))
|
||||
(start_list "geruest_typ")
|
||||
(foreach opt *ssg-geruest-optionen* (add_list opt))
|
||||
(end_list)
|
||||
(set_tile "geruest_typ"
|
||||
(itoa (ssg-geruest-typ-to-idx (if prefill (cdr (assoc "geruest-typ" prefill)) nil))))
|
||||
|
||||
;; Actions
|
||||
(action_tile "accept"
|
||||
(strcat
|
||||
@@ -1753,6 +1772,8 @@
|
||||
"(setq dlg-ein-winkel (get_tile \"ein_winkel\"))"
|
||||
"(setq dlg-ein (get_tile \"ein_seite\"))"
|
||||
"(setq dlg-dim (get_tile \"dimension\"))"
|
||||
"(setq dlg-geruest-einzelmodul (get_tile \"geruest_einzelmodul\"))"
|
||||
"(setq dlg-geruest-typ (get_tile \"geruest_typ\"))"
|
||||
"(done_dialog 1)"
|
||||
)
|
||||
)
|
||||
@@ -1779,6 +1800,8 @@
|
||||
(setq as-winkel (if (= dlg-aus-winkel "1") "30" "90"))
|
||||
(setq es-winkel (if (= dlg-ein-winkel "1") "30" "90"))
|
||||
(setq dim (if (= dlg-dim "1") "2D" "3D"))
|
||||
(setq geruest-einzelmodul dlg-geruest-einzelmodul)
|
||||
(setq geruest-typ (ssg-geruest-idx-to-typ (atoi dlg-geruest-typ)))
|
||||
(list
|
||||
(atof dlg-deltal)
|
||||
(atof dlg-winkel)
|
||||
@@ -1788,7 +1811,9 @@
|
||||
(atof dlg-hoehe)
|
||||
as-winkel
|
||||
es-winkel
|
||||
dim)
|
||||
dim
|
||||
geruest-einzelmodul
|
||||
geruest-typ)
|
||||
)
|
||||
(t nil)
|
||||
)
|
||||
@@ -1804,7 +1829,8 @@
|
||||
;; wurde (Modus 1) - dann entfaellt die zusaetzliche Konsolen-Rueckfrage.
|
||||
;; Modus 2 (reine Konsoleneingabe, kein Dialog) uebergibt nil/weglassen.
|
||||
(defun gf-modus12-abschluss (deltaL winkel hz-winkel as-seite es-seite startpunkt
|
||||
as-winkel es-winkel dialog-bestaetigt /
|
||||
as-winkel es-winkel dialog-bestaetigt
|
||||
geruest-einzelmodul geruest-typ /
|
||||
rad sep-x L_stau antwort)
|
||||
(if (null as-winkel) (setq as-winkel "90"))
|
||||
(if (null es-winkel) (setq es-winkel "90"))
|
||||
@@ -1842,7 +1868,8 @@
|
||||
;; Bestaetigung - entfaellt, wenn bereits per Dialog-OK bestaetigt (Modus 1)
|
||||
(setq antwort (if dialog-bestaetigt "1" (getstring (ssg-text "gf-prompt-einfuegen"))))
|
||||
(if (not (= antwort "2"))
|
||||
(gefaellestrecke-einfuegen L_stau (fix winkel) startpunkt as-seite es-seite hz-winkel deltaL as-winkel es-winkel)
|
||||
(gefaellestrecke-einfuegen L_stau (fix winkel) startpunkt as-seite es-seite hz-winkel deltaL as-winkel es-winkel
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(princ (ssg-text "gf-status-abgebrochen"))
|
||||
)
|
||||
)
|
||||
@@ -1851,7 +1878,7 @@
|
||||
;; setzen, L_stau berechnen und einfuegen - ohne Zusammenfassung/Rueckfrage.
|
||||
;; Rueckgabe: (ename deltaH deltaL) von gefaellestrecke-einfuegen oder nil.
|
||||
(defun gf-rebuild (deltaL winkel hz-winkel as-seite es-seite startpunkt
|
||||
as-winkel es-winkel /
|
||||
as-winkel es-winkel geruest-einzelmodul geruest-typ /
|
||||
rad sep-x L_stau)
|
||||
(if (null as-winkel) (setq as-winkel "90"))
|
||||
(if (null es-winkel) (setq es-winkel "90"))
|
||||
@@ -1867,7 +1894,8 @@
|
||||
nil
|
||||
)
|
||||
(gefaellestrecke-einfuegen
|
||||
L_stau (fix winkel) startpunkt as-seite es-seite hz-winkel deltaL as-winkel es-winkel)
|
||||
L_stau (fix winkel) startpunkt as-seite es-seite hz-winkel deltaL as-winkel es-winkel
|
||||
geruest-einzelmodul geruest-typ)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1912,7 +1940,7 @@
|
||||
as-seite es-seite gf-as-winkel gf-es-winkel
|
||||
line-points startpunkt endpunkt differenz
|
||||
deltaX deltaY startpunkt-fuer-einfuegen hz-winkel
|
||||
dlg-werte)
|
||||
dlg-werte gf-dim gf-geruest-einzelmodul gf-geruest-typ)
|
||||
|
||||
(princ "\n=========================================")
|
||||
(princ (ssg-text "gf-banner-titel"))
|
||||
@@ -1995,9 +2023,12 @@
|
||||
(setq antwort (getstring (ssg-text "prompt-wahl-1-2")))
|
||||
(setq es-seite (if (= antwort "2") "rechts" "links"))
|
||||
|
||||
;; Gemeinsamer Abschluss (Masse, Laenge, Zusammenfassung, Einfuegen)
|
||||
;; Gemeinsamer Abschluss (Masse, Laenge, Zusammenfassung, Einfuegen).
|
||||
;; Geruest fuer Einzelmodul/Geruestoption sind in Modus 2 (reine
|
||||
;; Konsoleneingabe, kein Dialog) nicht abfragbar - bleiben auf Default.
|
||||
(gf-modus12-abschluss deltaL winkel hz-winkel as-seite es-seite
|
||||
startpunkt-fuer-einfuegen gf-as-winkel gf-es-winkel)
|
||||
startpunkt-fuer-einfuegen gf-as-winkel gf-es-winkel nil
|
||||
"0" "Schoenenberger Geruest")
|
||||
)
|
||||
|
||||
;; Modus 1: Manuelle Eingabe via DCL-Dialog
|
||||
@@ -2020,7 +2051,10 @@
|
||||
as-seite (nth 3 dlg-werte)
|
||||
es-seite (nth 4 dlg-werte)
|
||||
gf-as-winkel (nth 6 dlg-werte)
|
||||
gf-es-winkel (nth 7 dlg-werte))
|
||||
gf-es-winkel (nth 7 dlg-werte)
|
||||
gf-dim (nth 8 dlg-werte)
|
||||
gf-geruest-einzelmodul (nth 9 dlg-werte)
|
||||
gf-geruest-typ (nth 10 dlg-werte))
|
||||
;; Einfuegehoehe = Dialogwert (nth 5), der mit der gepickten Hoehe
|
||||
;; vorbelegt wurde. So gewinnt die gepickte Hoehe standardmaessig,
|
||||
;; bleibt aber im Dialog editierbar. Nur diese Z-Hoehe zaehlt (X/Y
|
||||
@@ -2034,9 +2068,13 @@
|
||||
(setq deltaL (ssg-cfg-or "gefaelle" "default_delta_l" 5000.0)))
|
||||
(if (or (null winkel) (<= winkel 0))
|
||||
(setq winkel (ssg-cfg-or "gefaelle" "default_winkel" 3.0)))
|
||||
;; Gewaehlte Dimension (2D/3D) fuer den Bau erzwingen (Override), danach zurueck.
|
||||
(setq *ssg-ils-dim* gf-dim)
|
||||
;; Dialog-OK wurde bereits bestaetigt - keine zusaetzliche Rueckfrage
|
||||
(gf-modus12-abschluss deltaL winkel hz-winkel as-seite es-seite
|
||||
startpunkt-fuer-einfuegen gf-as-winkel gf-es-winkel T)
|
||||
startpunkt-fuer-einfuegen gf-as-winkel gf-es-winkel T
|
||||
gf-geruest-einzelmodul gf-geruest-typ)
|
||||
(setq *ssg-ils-dim* nil)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2101,8 +2139,11 @@
|
||||
(caddr gf-start)))
|
||||
;; VF bauen; Rueckgabe (vf-insert vf-endpunkt), vf-endpunkt = tatsaechl.
|
||||
;; ES-KS_AUS als Weltpunkt (aus vfs-es-teil/insert-block-by-ks).
|
||||
;; Geruest fuer Einzelmodul/Geruestoption sind fuer diesen automatisch
|
||||
;; nebenan gebauten VF nicht abfragbar - bleiben auf Schema-Default.
|
||||
(setq vf-erg (vfs-standard-dialog-berechnen-einfuegen
|
||||
(vf-next-number) deltaL deltaH "Auf" vf-start hz-vf vf-seite nil))
|
||||
(vf-next-number) deltaL deltaH "Auf" vf-start hz-vf vf-seite nil
|
||||
"0" "Schoenenberger Geruest"))
|
||||
(setq vf-insert (car vf-erg) vf-endpunkt (cadr vf-erg))
|
||||
;; Selbstkorrektur: fertigen VF-Block so verschieben, dass sein
|
||||
;; tatsaechliches ES-KS_AUS exakt auf ziel-es faellt (analog GF_n-Move;
|
||||
@@ -2128,7 +2169,7 @@
|
||||
;; Startpunkt neu auf. Rueckgabe: T bei Erfolg, nil wenn nicht nachbaubar.
|
||||
(defun gf-konvertiere-ent (ent ziel-dim / ed bname attribs xd hz winkel
|
||||
as-winkel es-winkel z-start deltaL startpunkt
|
||||
as-seite es-seite)
|
||||
as-seite es-seite geruest-einzelmodul geruest-typ)
|
||||
(setq ed (entget ent) bname (cdr (assoc 2 ed)))
|
||||
(setq attribs (ssg-attrib-read ent))
|
||||
(setq xd (gf-xdata-lesen ent))
|
||||
@@ -2145,10 +2186,14 @@
|
||||
deltaL (atof (nth 5 xd)))
|
||||
(setq as-seite (cond ((cdr (assoc "SEITE_AS" attribs))) ("links")))
|
||||
(setq es-seite (cond ((cdr (assoc "SEITE_ES" attribs))) ("links")))
|
||||
;; bestehende Geruest-Einstellungen erhalten
|
||||
(setq geruest-einzelmodul (cond ((cdr (assoc "GERUEST_EINZELMODUL" attribs))) ("0")))
|
||||
(setq geruest-typ (cdr (assoc "GERUEST_TYP" attribs)))
|
||||
(setq *ssg-ils-dim* ziel-dim)
|
||||
(entdel ent)
|
||||
(gf-rebuild deltaL winkel hz as-seite es-seite
|
||||
(list (car startpunkt) (cadr startpunkt) z-start) as-winkel es-winkel)
|
||||
(list (car startpunkt) (cadr startpunkt) z-start) as-winkel es-winkel
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq *ssg-ils-dim* nil)
|
||||
T)
|
||||
nil))
|
||||
@@ -2224,7 +2269,9 @@
|
||||
(cons "as-winkel" as-winkel)
|
||||
(cons "es-winkel" es-winkel)
|
||||
;; Dimension aus XDATA erkennen (Default 3D, falls Alt-Block ohne Eintrag)
|
||||
(cons "dim" (cond ((ssg-dim-xdata-lesen ent)) ("3D")))))
|
||||
(cons "dim" (cond ((ssg-dim-xdata-lesen ent)) ("3D")))
|
||||
(cons "geruest-einzelmodul" (cond ((cdr (assoc "GERUEST_EINZELMODUL" attribs))) ("0")))
|
||||
(cons "geruest-typ" (cdr (assoc "GERUEST_TYP" attribs)))))
|
||||
|
||||
;; AS-Seite + untere Hoehe fuer den optionalen parallelen VF-Bau
|
||||
(setq as-seite (cond ((cdr (assoc "SEITE_AS" attribs))) ("links")))
|
||||
@@ -2253,7 +2300,8 @@
|
||||
(nth 0 dlg-werte) (nth 1 dlg-werte) (nth 2 dlg-werte)
|
||||
(nth 3 dlg-werte) (nth 4 dlg-werte)
|
||||
(list (car startpunkt) (cadr startpunkt) (nth 5 dlg-werte))
|
||||
(nth 6 dlg-werte) (nth 7 dlg-werte))
|
||||
(nth 6 dlg-werte) (nth 7 dlg-werte)
|
||||
(nth 9 dlg-werte) (nth 10 dlg-werte))
|
||||
(setq *ssg-ils-dim* nil)
|
||||
(princ (ssg-textf "gf-edit-neu-aufgebaut" (list bname)))
|
||||
)
|
||||
|
||||
+22
-3
@@ -87,6 +87,7 @@
|
||||
("ANZAHL_SCANNER" "0")
|
||||
("ANZAHL_RAMPEN" "0")
|
||||
("GERUEST_EINZELMODUL" "0")
|
||||
("GERUEST_TYP" "Schoenenberger Geruest")
|
||||
("DREHRICHTUNG" "UZS")
|
||||
("DREHUNG" "0")
|
||||
("NUMMER" "0"))
|
||||
@@ -102,6 +103,8 @@
|
||||
("DREHUNG" "0")
|
||||
("NUMMER" "0")
|
||||
("HOEHE" "0")
|
||||
("GERUEST_EINZELMODUL" "0")
|
||||
("GERUEST_TYP" "Schoenenberger Geruest")
|
||||
("ID" ""))
|
||||
)
|
||||
|
||||
@@ -869,6 +872,7 @@
|
||||
dcl-pfad dat ergebnis
|
||||
dlg-name dlg-abstand dlg-hoehe dlg-ausrichtung
|
||||
dlg-drehrichtung dlg-kreiselart dlg-geruest-einzelmodul
|
||||
dlg-geruest-typ
|
||||
newAbstand newRotation ausrichtLabels)
|
||||
|
||||
;; Implied Selection VOR ssg-start pruefen (ssg-start hebt Selektion auf)
|
||||
@@ -966,6 +970,11 @@
|
||||
(set_tile "geruest_einzelmodul"
|
||||
(if (equal (cdr (assoc "GERUEST_EINZELMODUL" attribs)) "1") "1" "0"))
|
||||
|
||||
(start_list "geruest_typ")
|
||||
(foreach opt *ssg-geruest-optionen* (add_list opt))
|
||||
(end_list)
|
||||
(set_tile "geruest_typ" (itoa (ssg-geruest-typ-to-idx (cdr (assoc "GERUEST_TYP" attribs)))))
|
||||
|
||||
;; Actions
|
||||
(action_tile "accept"
|
||||
(strcat
|
||||
@@ -976,6 +985,7 @@
|
||||
"(setq dlg-drehrichtung (get_tile \"drehrichtung\"))"
|
||||
"(setq dlg-kreiselart (get_tile \"kreiselart\"))"
|
||||
"(setq dlg-geruest-einzelmodul (get_tile \"geruest_einzelmodul\"))"
|
||||
"(setq dlg-geruest-typ (get_tile \"geruest_typ\"))"
|
||||
"(done_dialog 1)"
|
||||
)
|
||||
)
|
||||
@@ -1004,6 +1014,8 @@
|
||||
(assoc "DREHRICHTUNG" attribs) attribs))
|
||||
(setq attribs (subst (cons "GERUEST_EINZELMODUL" dlg-geruest-einzelmodul)
|
||||
(assoc "GERUEST_EINZELMODUL" attribs) attribs))
|
||||
(setq attribs (subst (cons "GERUEST_TYP" (ssg-geruest-idx-to-typ (atoi dlg-geruest-typ)))
|
||||
(assoc "GERUEST_TYP" attribs) attribs))
|
||||
|
||||
;; Alten Block loeschen
|
||||
(command "_.ERASE" ent "")
|
||||
@@ -1051,7 +1063,8 @@
|
||||
;; 4. Hoehe aus Z-Koordinate oder manuell
|
||||
;; --------------------------------------------
|
||||
(defun c:ILS_Eckrad ( / ptTangent ptDir dx dy dist ux uy radius
|
||||
centerPt rotation hoehe)
|
||||
centerPt rotation hoehe
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(dbgf "c:ILS_Eckrad")
|
||||
|
||||
;; 1. Beruehrpunkt (Tangentenpunkt)
|
||||
@@ -1106,8 +1119,14 @@
|
||||
)
|
||||
(dbg 'hoehe)
|
||||
|
||||
;; 5. Einfuegen (centerPt ist der Kreismittelpunkt)
|
||||
(ils-eckrad-insert (list (car centerPt) (cadr centerPt) hoehe) rotation nil)
|
||||
;; 5. Geruest fuer Einzelmodul + Geruestoption abfragen
|
||||
(setq geruest-einzelmodul (if (ssg-ques (ssg-text "kreisel-eckrad-geruest-frage") nil) "0" "1"))
|
||||
(setq geruest-typ (ssg-ask-geruest-typ))
|
||||
|
||||
;; 6. Einfuegen (centerPt ist der Kreismittelpunkt)
|
||||
(ils-eckrad-insert (list (car centerPt) (cadr centerPt) hoehe) rotation
|
||||
(list (cons "GERUEST_EINZELMODUL" geruest-einzelmodul)
|
||||
(cons "GERUEST_TYP" geruest-typ)))
|
||||
(dbgreturn nil)
|
||||
)
|
||||
|
||||
|
||||
+85
-18
@@ -13,25 +13,39 @@
|
||||
;; (ssg-start "Titel" '(("OSMODE") ("ORTHOMODE")))
|
||||
;; ... Makrocode ...
|
||||
;; (ssg-end)
|
||||
;;
|
||||
;; Nestbar ueber *ssg-start-stack*: jedes ssg-start legt einen eigenen
|
||||
;; Frame (vorheriger *error*-Handler + Variablenwerte) oben auf den
|
||||
;; Stack, ssg-end nimmt genau diesen Frame wieder herunter. Noetig, weil
|
||||
;; z.B. ein Test-Wrapper (ssg-start "TEST_KREISEL" ...) selbst wieder
|
||||
;; Makros aufruft, die ihrerseits ssg-start/ssg-end nutzen - mit einer
|
||||
;; einzelnen globalen Variable statt eines Stacks wuerde der innere
|
||||
;; Aufruf den *error*-Handler und die CLAYER/CMDECHO/...-Werte des
|
||||
;; aeusseren Aufrufs ueberschreiben. Ergebnis waere ein *error* wird
|
||||
;; nach dem aeusseren ssg-end dauerhaft an ssg-errhan haengen bleiben
|
||||
;; (statt zum urspruenglichen Default-Handler zurueckzukehren) und bei
|
||||
;; jedem folgenden Fehler faelschlich veraltete CLAYER/CECOLOR-Werte
|
||||
;; ueber "_LAYER"/"_undo" auf die Kommandozeile schreiben.
|
||||
;; ------------------------------------------------------------
|
||||
|
||||
(defun ssg-start (titel zusatz-vars / xlen xpos xvar)
|
||||
(if (not (boundp '*ssg-start-stack*)) (setq *ssg-start-stack* nil))
|
||||
|
||||
(defun ssg-start (titel zusatz-vars / cavar xlen xpos xvar)
|
||||
;; titel - Anzeigename des Makros
|
||||
;; zusatz-vars - Liste zusaetzlicher Variablen z.B. '(("OSMODE")("ORTHOMODE"))
|
||||
;; Immer CLAYER und CMDECHO werden automatisch gesichert.
|
||||
(setq _ssg-olderr *error*
|
||||
*error* (function ssg-errhan)
|
||||
_ssg-cavar (append '(("CLAYER") ("CMDECHO")) zusatz-vars)
|
||||
xlen (length _ssg-cavar)
|
||||
xpos 0
|
||||
(setq cavar (append '(("CLAYER") ("CMDECHO")) zusatz-vars)
|
||||
xlen (length cavar)
|
||||
xpos 0
|
||||
)
|
||||
(repeat xlen
|
||||
(setq xvar (car (nth xpos _ssg-cavar))
|
||||
_ssg-cavar (subst (cons xvar (getvar xvar))
|
||||
(nth xpos _ssg-cavar) _ssg-cavar)
|
||||
xpos (1+ xpos)
|
||||
(setq xvar (car (nth xpos cavar))
|
||||
cavar (subst (cons xvar (getvar xvar)) (nth xpos cavar) cavar)
|
||||
xpos (1+ xpos)
|
||||
)
|
||||
)
|
||||
(setq *ssg-start-stack* (cons (cons *error* cavar) *ssg-start-stack*))
|
||||
(setq *error* (function ssg-errhan))
|
||||
(setvar "CMDECHO" 0)
|
||||
(command "_undo" "_G")
|
||||
(graphscr)
|
||||
@@ -39,26 +53,30 @@
|
||||
(princ)
|
||||
)
|
||||
|
||||
(defun ssg-end (/ xpos xlen xvar)
|
||||
(if _ssg-cavar
|
||||
(defun ssg-end (/ frame cavar xpos xlen xvar)
|
||||
(if *ssg-start-stack*
|
||||
(progn
|
||||
(setq frame (car *ssg-start-stack*)
|
||||
*ssg-start-stack* (cdr *ssg-start-stack*)
|
||||
cavar (cdr frame)
|
||||
)
|
||||
(command)
|
||||
(command "_undo" "_E")
|
||||
(setq xpos 1
|
||||
xlen (length _ssg-cavar)
|
||||
xlen (length cavar)
|
||||
)
|
||||
(if (/= (getvar "CLAYER") (caar _ssg-cavar))
|
||||
(command "_LAYER" "_SE" (cdar _ssg-cavar) "")
|
||||
(if (/= (getvar "CLAYER") (caar cavar))
|
||||
(command "_LAYER" "_SE" (cdar cavar) "")
|
||||
)
|
||||
(repeat (1- xlen)
|
||||
(setq xvar (nth xpos _ssg-cavar)
|
||||
(setq xvar (nth xpos cavar)
|
||||
xpos (1+ xpos)
|
||||
)
|
||||
(setvar (car xvar) (cdr xvar))
|
||||
)
|
||||
(setq *error* (car frame))
|
||||
)
|
||||
)
|
||||
(if _ssg-olderr (setq *error* _ssg-olderr))
|
||||
(princ)
|
||||
)
|
||||
|
||||
@@ -602,7 +620,56 @@
|
||||
;; (einsegmentige Gefaellestrecke: 1; Streckengruppe: gezaehlt).
|
||||
(setq *strecke-attr-hinten*
|
||||
'(("ANZAHL_SEPARATOR" "1")
|
||||
("ANZAHL_SCANNER" "0")))
|
||||
("ANZAHL_SCANNER" "0")
|
||||
("GERUEST_EINZELMODUL" "0")
|
||||
("GERUEST_TYP" "Schoenenberger Geruest")))
|
||||
|
||||
;; ============================================================
|
||||
;; GERUESTOPTION - gemeinsame Combobox-Werte fuer Kreisel, Eckrad,
|
||||
;; VarioFoerderer und Gefaellestrecke (Attribut GERUEST_TYP).
|
||||
;; Reihenfolge = Reihenfolge in der Dialog-Combobox. Index 2
|
||||
;; ("Schoenenberger Geruest") ist der Default.
|
||||
;; ============================================================
|
||||
(setq *ssg-geruest-optionen*
|
||||
'("IPE-Geruest abgestuft"
|
||||
"Obergeruest oben"
|
||||
"Schoenenberger Geruest"
|
||||
"nur Doppelrohrtraeger")
|
||||
)
|
||||
|
||||
;; Geruest-Typ (String) -> Combobox-Index. Unbekannter/leerer Wert -> Default (2).
|
||||
(defun ssg-geruest-typ-to-idx (typ / idx i gefunden)
|
||||
(setq idx 2 i 0 gefunden nil)
|
||||
(foreach opt *ssg-geruest-optionen*
|
||||
(if (and (not gefunden) (equal typ opt))
|
||||
(progn (setq idx i) (setq gefunden T))
|
||||
)
|
||||
(setq i (1+ i))
|
||||
)
|
||||
idx
|
||||
)
|
||||
|
||||
;; Combobox-Index -> Geruest-Typ (String).
|
||||
(defun ssg-geruest-idx-to-typ (idx)
|
||||
(nth idx *ssg-geruest-optionen*)
|
||||
)
|
||||
|
||||
;; Geruestoption per Kommandozeilen-Menue abfragen (fuer Module ohne DCL-Dialog,
|
||||
;; z.B. ILS_Eckrad). Rueckgabe: Geruest-Typ-String aus *ssg-geruest-optionen*.
|
||||
(defun ssg-ask-geruest-typ ( / i opt antwort idx)
|
||||
(princ (ssg-text "geruest-typ-header"))
|
||||
(setq i 1)
|
||||
(foreach opt *ssg-geruest-optionen*
|
||||
(princ (ssg-textf "geruest-typ-opt" (list i opt)))
|
||||
(setq i (1+ i))
|
||||
)
|
||||
(setq antwort (getint (ssg-textf "geruest-typ-prompt" (list (itoa (1+ (ssg-geruest-typ-to-idx nil)))))))
|
||||
(if (or (null antwort) (< antwort 1) (> antwort (length *ssg-geruest-optionen*)))
|
||||
(setq idx (ssg-geruest-typ-to-idx nil))
|
||||
(setq idx (1- antwort))
|
||||
)
|
||||
(ssg-geruest-idx-to-typ idx)
|
||||
)
|
||||
|
||||
;; Geordnete ATTDEF-Definitionsliste fuer einen Strecken-Block-Typ.
|
||||
;; typ "Gefaellestrecke" -> Vorderteil + Hinterteil (reduziert)
|
||||
|
||||
+10
-1
@@ -1062,8 +1062,11 @@
|
||||
(defun 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
|
||||
geruest-einzelmodul geruest-typ
|
||||
/ vf-bname vf-ss vf-e vf-insert montagehoehe-m attdef-ypos L_GF_m-str)
|
||||
(if (null hz) (setq hz 0.0))
|
||||
(if (null geruest-einzelmodul) (setq geruest-einzelmodul "0"))
|
||||
(if (null geruest-typ) (setq geruest-typ (ssg-geruest-idx-to-typ (ssg-geruest-typ-to-idx nil))))
|
||||
;; Beschriftungstext erzeugen
|
||||
(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)
|
||||
@@ -1134,6 +1137,8 @@
|
||||
(cons "VF_WINKEL" (itoa best-winkel))
|
||||
(cons "ANZAHL_SEPARATOR" "2")
|
||||
(cons "ANZAHL_SCANNER" (itoa n-scanner))
|
||||
(cons "GERUEST_EINZELMODUL" geruest-einzelmodul)
|
||||
(cons "GERUEST_TYP" geruest-typ)
|
||||
)
|
||||
)
|
||||
;; Typ-spezifische Bogen-Zaehler (Etage: 2x Gefaellebogen je Seite)
|
||||
@@ -1439,10 +1444,14 @@
|
||||
(list deltaL deltaH richtung best-winkel L_GF1 L_GF2 L_VF startpunkt seite hz))
|
||||
|
||||
;; Gemeinsame VF_*-Block-Erstellung
|
||||
;; Geruest fuer Einzelmodul/Geruestoption sind in diesem interaktiven
|
||||
;; Konsolen-Ablauf (Etage/Linienzug) nicht abfragbar - bleiben auf
|
||||
;; Schema-Default (analog Kreisel: nur ueber Dialog editierbar).
|
||||
(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))
|
||||
richtung best-winkel startpunkt lastEnt hz
|
||||
"0" "Schoenenberger Geruest"))
|
||||
|
||||
;; Standard-Bloecke aus dem interaktiven Konsolen-Ablauf ebenfalls mit der
|
||||
;; SSG_VF_EDIT-XDATA markieren - sie sind (wie die Dialog-Variante) aus
|
||||
|
||||
+45
-16
@@ -709,15 +709,18 @@
|
||||
;; ============================================================
|
||||
|
||||
;; Basis-Eingabe (Dialog 1): deltaL, deltaH, Richtung, Einfuegehoehe,
|
||||
;; Fahrtrichtung, Seite.
|
||||
;; Fahrtrichtung, Seite, Geruest fuer Einzelmodul, Geruestoption.
|
||||
;; prefill: Assoziationsliste zur Vorbelegung (fuer VARIOFOERDERER_EDIT) mit
|
||||
;; Schluesseln "deltaL" "deltaH" "richtung" "einfuegehoehe" "hz" "seite"
|
||||
;; - oder nil fuer Neuanlage mit Defaults.
|
||||
;; Rueckgabe: (deltaL deltaH richtung einfuegehoehe hz seite) oder nil bei Abbruch.
|
||||
;; "geruest-einzelmodul" "geruest-typ" - oder nil fuer Neuanlage mit Defaults.
|
||||
;; Rueckgabe: (deltaL deltaH richtung einfuegehoehe hz seite
|
||||
;; geruest-einzelmodul geruest-typ) oder nil bei Abbruch.
|
||||
(defun vfs-dialog-eingabe-basis (prefill / dcl-pfad dat ergebnis
|
||||
dlg-deltal dlg-deltah dlg-richtung dlg-hoehe
|
||||
dlg-fahrtrichtung dlg-seite dlg-dimension
|
||||
deltaL deltaH richtung hz seite z-start dim)
|
||||
dlg-geruest-einzelmodul dlg-geruest-typ
|
||||
deltaL deltaH richtung hz seite z-start dim
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq dcl-pfad (strcat (getenv "DXFM_DCL") "/variofoerderer.dcl"))
|
||||
(setq dat (load_dialog dcl-pfad))
|
||||
(if (not (new_dialog "variofoerderer_basis" dat))
|
||||
@@ -771,6 +774,13 @@
|
||||
(end_list)
|
||||
(set_tile "dimension"
|
||||
(if (equal (cond ((cdr (assoc "dim" prefill))) ((ssg-ils-dim-aktuell))) "2D") "1" "0"))
|
||||
(set_tile "geruest_einzelmodul"
|
||||
(if (and prefill (equal (cdr (assoc "geruest-einzelmodul" prefill)) "1")) "1" "0"))
|
||||
(start_list "geruest_typ")
|
||||
(foreach opt *ssg-geruest-optionen* (add_list opt))
|
||||
(end_list)
|
||||
(set_tile "geruest_typ"
|
||||
(itoa (ssg-geruest-typ-to-idx (if prefill (cdr (assoc "geruest-typ" prefill)) nil))))
|
||||
|
||||
;; Actions
|
||||
(action_tile "accept"
|
||||
@@ -782,6 +792,8 @@
|
||||
"(setq dlg-fahrtrichtung (get_tile \"fahrtrichtung\"))"
|
||||
"(setq dlg-seite (get_tile \"seite\"))"
|
||||
"(setq dlg-dimension (get_tile \"dimension\"))"
|
||||
"(setq dlg-geruest-einzelmodul (get_tile \"geruest_einzelmodul\"))"
|
||||
"(setq dlg-geruest-typ (get_tile \"geruest_typ\"))"
|
||||
"(done_dialog 1)"
|
||||
)
|
||||
)
|
||||
@@ -803,7 +815,9 @@
|
||||
(t 0.0)))
|
||||
(setq seite (if (= dlg-seite "1") "links" "rechts"))
|
||||
(setq dim (if (= dlg-dimension "1") "2D" "3D"))
|
||||
(list deltaL deltaH richtung z-start hz seite dim)
|
||||
(setq geruest-einzelmodul dlg-geruest-einzelmodul)
|
||||
(setq geruest-typ (ssg-geruest-idx-to-typ (atoi dlg-geruest-typ)))
|
||||
(list deltaL deltaH richtung z-start hz seite dim geruest-einzelmodul geruest-typ)
|
||||
)
|
||||
nil
|
||||
)
|
||||
@@ -955,7 +969,7 @@
|
||||
;; winkel-prefill: Vorbelegung fuer vfs-dialog-winkel-verteilung oder nil.
|
||||
;; ============================================================
|
||||
(defun vfs-standard-dialog-berechnen-einfuegen (vf-nummer deltaL deltaH richtung startpunkt hz seite
|
||||
winkel-prefill /
|
||||
winkel-prefill geruest-einzelmodul geruest-typ /
|
||||
ergebnis ergebnis-liste gueltige-winkel horizontal-info
|
||||
winkelwahl best-winkel L_GF L_VF L_GF1 L_GF2 verteilung-modus
|
||||
n-scanner hoehe-von hoehe-bis lastEnt vf-insert vf-endpunkt staustrecke-basis)
|
||||
@@ -1014,7 +1028,8 @@
|
||||
(setq vf-insert
|
||||
(vf-block-erstellen "standard" seite vf-nummer n-scanner
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz))
|
||||
richtung best-winkel startpunkt lastEnt hz
|
||||
geruest-einzelmodul geruest-typ))
|
||||
(if vf-insert (vfs-xdata-schreiben vf-insert hz))
|
||||
(princ "\n=========================================")
|
||||
)
|
||||
@@ -1029,7 +1044,8 @@
|
||||
;; Neuanlage (Menue/Konsole -> Dialog): Startpunkt (X/Y) picken, Basis-Dialog,
|
||||
;; dann gemeinsame Berechnung/Winkel-Dialog/Einfuegung.
|
||||
(defun vfs-standard-dialog-ablauf (vf-nummer / eingabe deltaL deltaH richtung
|
||||
z-start hz seite startpunkt startpunkt-xy dim)
|
||||
z-start hz seite startpunkt startpunkt-xy dim
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq startpunkt-xy (getpoint (ssg-text "vfc-prompt-startpunkt-aus")))
|
||||
(if (null startpunkt-xy) (setq startpunkt-xy '(0 0 0)))
|
||||
|
||||
@@ -1043,11 +1059,14 @@
|
||||
z-start (nth 3 eingabe)
|
||||
hz (nth 4 eingabe)
|
||||
seite (nth 5 eingabe)
|
||||
dim (nth 6 eingabe))
|
||||
dim (nth 6 eingabe)
|
||||
geruest-einzelmodul (nth 7 eingabe)
|
||||
geruest-typ (nth 8 eingabe))
|
||||
(setq startpunkt (list (car startpunkt-xy) (cadr startpunkt-xy) z-start))
|
||||
;; Gewaehlte Dimension (2D/3D) fuer den Bau erzwingen (Override), danach zurueck.
|
||||
(setq *ssg-ils-dim* dim)
|
||||
(vfs-standard-dialog-berechnen-einfuegen vf-nummer deltaL deltaH richtung startpunkt hz seite nil)
|
||||
(vfs-standard-dialog-berechnen-einfuegen vf-nummer deltaL deltaH richtung startpunkt hz seite nil
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq *ssg-ils-dim* nil)
|
||||
)
|
||||
)
|
||||
@@ -1059,7 +1078,8 @@
|
||||
;; per Override und baut am selben Startpunkt neu auf. Rueckgabe: T/nil.
|
||||
(defun vf-konvertiere-ent (ent ziel-dim / ed bname xd attribs startpunkt hz
|
||||
deltaL deltaH richtung seite best-winkel L_GF_m-teile
|
||||
L_GF1 L_GF2 L_VF hoehe-von hoehe-bis lastEnt vf-insert vf-nummer)
|
||||
L_GF1 L_GF2 L_VF hoehe-von hoehe-bis lastEnt vf-insert vf-nummer
|
||||
geruest-einzelmodul geruest-typ)
|
||||
(setq ed (entget ent) bname (cdr (assoc 2 ed)))
|
||||
(setq xd (vfs-xdata-lesen ent))
|
||||
(if (and (wcmatch bname "VF_*") xd (= (car xd) "standard"))
|
||||
@@ -1076,6 +1096,9 @@
|
||||
(setq L_GF1 (* 1000.0 (atof (car L_GF_m-teile))))
|
||||
(setq L_GF2 (* 1000.0 (atof (cadr L_GF_m-teile))))
|
||||
(setq L_VF (* 1000.0 (atof (cond ((cdr (assoc "L_VF_m" attribs))) ("0.0")))))
|
||||
;; bestehende Geruest-Einstellungen erhalten
|
||||
(setq geruest-einzelmodul (cond ((cdr (assoc "GERUEST_EINZELMODUL" attribs))) ("0")))
|
||||
(setq geruest-typ (cdr (assoc "GERUEST_TYP" attribs)))
|
||||
(setq hoehe-von (caddr startpunkt))
|
||||
(setq hoehe-bis (cond ((= richtung "Auf") (+ hoehe-von deltaH))
|
||||
((= richtung "Ab") (- hoehe-von deltaH))
|
||||
@@ -1088,7 +1111,8 @@
|
||||
(setq vf-insert
|
||||
(vf-block-erstellen "standard" seite vf-nummer 0
|
||||
hoehe-von hoehe-bis deltaH deltaL L_VF L_GF1 L_GF2
|
||||
richtung best-winkel startpunkt lastEnt hz))
|
||||
richtung best-winkel startpunkt lastEnt hz
|
||||
geruest-einzelmodul geruest-typ))
|
||||
(if vf-insert (vfs-xdata-schreiben vf-insert hz))
|
||||
(setq *ssg-ils-dim* nil)
|
||||
(if vf-insert T nil))
|
||||
@@ -1108,7 +1132,8 @@
|
||||
(defun c:VARIOFOERDERER_EDIT ( / ss ent ed bname startpunkt attribs xd
|
||||
deltaL deltaH richtung z-start hz seite dim
|
||||
eingabe vf-nummer best-winkel-attr L_GF_m-teile
|
||||
prefill-basis prefill-winkel)
|
||||
prefill-basis prefill-winkel
|
||||
geruest-einzelmodul geruest-typ)
|
||||
;; Implied Selection VOR ssg-start pruefen (ssg-start hebt Selektion auf)
|
||||
(setq ss (ssget "I"))
|
||||
(if (and ss (= (sslength ss) 1)
|
||||
@@ -1149,7 +1174,9 @@
|
||||
(list (cons "deltaL" deltaL) (cons "deltaH" deltaH) (cons "richtung" richtung)
|
||||
(cons "einfuegehoehe" z-start) (cons "hz" hz) (cons "seite" seite)
|
||||
;; Dimension aus XDATA erkennen (Default 3D, falls Alt-Block ohne Eintrag)
|
||||
(cons "dim" (cond ((ssg-dim-xdata-lesen ent)) ("3D")))))
|
||||
(cons "dim" (cond ((ssg-dim-xdata-lesen ent)) ("3D")))
|
||||
(cons "geruest-einzelmodul" (cond ((cdr (assoc "GERUEST_EINZELMODUL" attribs))) ("0")))
|
||||
(cons "geruest-typ" (cdr (assoc "GERUEST_TYP" attribs)))))
|
||||
|
||||
(setq eingabe (vfs-dialog-eingabe-basis prefill-basis))
|
||||
(if (null eingabe)
|
||||
@@ -1161,7 +1188,9 @@
|
||||
z-start (nth 3 eingabe)
|
||||
hz (nth 4 eingabe)
|
||||
seite (nth 5 eingabe)
|
||||
dim (nth 6 eingabe))
|
||||
dim (nth 6 eingabe)
|
||||
geruest-einzelmodul (nth 7 eingabe)
|
||||
geruest-typ (nth 8 eingabe))
|
||||
(setq startpunkt (list (car startpunkt) (cadr startpunkt) z-start))
|
||||
|
||||
;; Vorbelegung Winkel/Verteilung: bestehenden Winkel vorschlagen, L_GF-
|
||||
@@ -1180,7 +1209,7 @@
|
||||
(entdel ent)
|
||||
(setq vf-nummer (vf-next-number))
|
||||
(vfs-standard-dialog-berechnen-einfuegen vf-nummer deltaL deltaH richtung
|
||||
startpunkt hz seite prefill-winkel)
|
||||
startpunkt hz seite prefill-winkel geruest-einzelmodul geruest-typ)
|
||||
(setq *ssg-ils-dim* nil)
|
||||
(princ (ssg-textf "vfs-edit-neu-aufgebaut" (list bname)))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user