2D/3D-Umschaltung pro GF/VF-Block (Dialog-Auswahl + Auto-Erkennung via XDATA) und Batch Alle auf 2D/3D

This commit is contained in:
2026-07-23 14:01:52 +02:00
parent 6d81b30628
commit 39a4656f38
11 changed files with 370 additions and 79 deletions
+61 -20
View File
@@ -115,22 +115,12 @@
;; --- Block als einzelne DWG-Datei aus block-pfad laden ---
(if (null (car (atoms-family 1 '("ENSURE-BLOCK-LOADED"))))
(defun ensure-block-loaded (blockname / block-datei temp-obj)
(if (not (tblsearch "BLOCK" blockname))
(defun ensure-block-loaded (blockname / )
;; Zentraler Loader (aktuelle Dimension + 3D-Fallback, Neudefinition bei
;; Dimensionswechsel). Meldung nur bei Fehlschlag.
(if (not (ssg-ils-block-laden blockname))
(progn
(setq block-datei (strcat block-pfad blockname ".dwg"))
(if (findfile block-datei)
(progn
(princ (ssg-textf "gf-lade-block" (list blockname)))
(setq temp-obj
(vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
block-datei 1.0 1.0 1.0 0))
(vla-Delete temp-obj)
(princ (ssg-text "gf-status-ok"))
)
(princ (ssg-textf "gf-fehler-blockdatei-fehlt" (list block-datei)))
)
(princ (ssg-textf "gf-fehler-blockdatei-fehlt" (list blockname)))
)
)
)
@@ -1644,6 +1634,8 @@
;; verlustfrei nachbauen kann. Nicht Teil des Sivas-Attributsatzes.
(gf-xdata-schreiben gf-insert hz winkel as-winkel es-winkel
ziel-hoehe deltaL-total)
;; Dimension (2D/3D) merken -> Doppelklick-Edit erkennt sie automatisch.
(ssg-dim-xdata-schreiben gf-insert (ssg-ils-dim-aktuell))
(princ "\n\n=========================================")
(princ (ssg-text "gf-status-erfolgreich-eingefuegt"))
@@ -1672,8 +1664,8 @@
(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
hz-winkel as-seite es-seite as-winkel es-winkel)
dlg-aus-winkel dlg-ein-winkel dlg-dim
hz-winkel as-seite es-seite as-winkel es-winkel dim)
(setq dcl-pfad (strcat (getenv "DXFM_DCL") "/gefaellestrecke.dcl"))
(setq dat (load_dialog dcl-pfad))
(if (not (new_dialog "gefaellestrecke" dat))
@@ -1712,6 +1704,15 @@
(t "0"))
"0"))
;; Darstellung 2D/3D: Vorbelegung aus prefill "dim" (Edit: erkannte
;; Dimension des Blocks), sonst aktueller Modus (Neuanlage -> i.d.R. 3D).
(start_list "dimension")
(add_list "3D")
(add_list "2D")
(end_list)
(set_tile "dimension"
(if (equal (cond ((cdr (assoc "dim" prefill))) ((ssg-ils-dim-aktuell))) "2D") "1" "0"))
;; AUS-Element: Winkel (90/30) + Seite
(start_list "aus_winkel")
(add_list "90")
@@ -1751,6 +1752,7 @@
"(setq dlg-aus (get_tile \"aus_seite\"))"
"(setq dlg-ein-winkel (get_tile \"ein_winkel\"))"
"(setq dlg-ein (get_tile \"ein_seite\"))"
"(setq dlg-dim (get_tile \"dimension\"))"
"(done_dialog 1)"
)
)
@@ -1776,6 +1778,7 @@
(setq es-seite (if (= dlg-ein "1") "rechts" "links"))
(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"))
(list
(atof dlg-deltal)
(atof dlg-winkel)
@@ -1784,7 +1787,8 @@
es-seite
(atof dlg-hoehe)
as-winkel
es-winkel)
es-winkel
dim)
)
(t nil)
)
@@ -2118,6 +2122,37 @@
)
)
;; Nicht-interaktive Umwandlung EINES bestehenden GF-Blocks in die Zieldimension
;; (fuer die Batch-Umschaltung "Alle auf 2D/3D"). Liest die Parameter aus
;; XDATA/Attributen, erzwingt die Zieldimension per Override und baut am selben
;; 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)
(setq ed (entget ent) bname (cdr (assoc 2 ed)))
(setq attribs (ssg-attrib-read ent))
(setq xd (gf-xdata-lesen ent))
(if (and (wcmatch bname "GF_*")
(= (cond ((cdr (assoc "TYP" attribs))) ("")) "Gefaellestrecke")
xd)
(progn
(setq startpunkt (cdr (assoc 10 ed)))
(setq hz (atof (nth 0 xd))
winkel (atof (nth 1 xd))
as-winkel (nth 2 xd)
es-winkel (nth 3 xd)
z-start (atof (nth 4 xd))
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")))
(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)
(setq *ssg-ils-dim* nil)
T)
nil))
(defun c:GEFAELLESTRECKE_EDIT ( / ss ent ed bname startpunkt attribs xd
hz winkel as-winkel es-winkel z-start deltaL
as-seite hoehe-bis prefill dlg-werte)
@@ -2187,7 +2222,9 @@
(cons "es-seite" (cond ((cdr (assoc "SEITE_ES" attribs))) ("links")))
(cons "einfuegehoehe" z-start)
(cons "as-winkel" as-winkel)
(cons "es-winkel" es-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")))))
;; AS-Seite + untere Hoehe fuer den optionalen parallelen VF-Bau
(setq as-seite (cond ((cdr (assoc "SEITE_AS" attribs))) ("links")))
@@ -2207,13 +2244,17 @@
hz deltaL as-seite hoehe-bis))
(t
;; Alten GF-Verbund loeschen und am selben Startpunkt (X/Y) mit der
;; im Dialog gewaehlten Einfuegehoehe (Z) neu aufbauen.
;; im Dialog gewaehlten Einfuegehoehe (Z) neu aufbauen. Die im Dialog
;; gewaehlte Dimension (2D/3D) wird ueber den Override *ssg-ils-dim*
;; erzwungen; gf-block-erstellen schreibt sie zugleich neu ins XDATA.
(setq *ssg-ils-dim* (nth 8 dlg-werte))
(entdel ent)
(gf-rebuild
(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))
(setq *ssg-ils-dim* nil)
(princ (ssg-textf "gf-edit-neu-aufgebaut" (list bname)))
)
)
+47 -7
View File
@@ -17,12 +17,11 @@
;; --- ILS / Zusatzmodul: Sensoren (Scanner / Separator) einfuegen ---
;; Ermittelt den Pfad zu einer Sensor-Blockdatei. Die Sensor-Bloecke
;; werden fest aus data/ils/3D geladen (unabhaengig von der
;; 2D/3D-Umschaltung).
(defun ils-sensor-pfad (fname / p)
(setq p (strcat (getenv "DXFMAKRO") "\\data\\ils\\3D\\" fname ".dwg"))
(if (findfile p) p nil)
;; Ermittelt den Pfad zu einer Sensor-Blockdatei. Folgt der 2D/3D-Umschaltung
;; (DXFM_DIM) mit automatischem 3D-Fallback - Scanner/Separator sind in 2D und
;; 3D identisch, laden also in beiden Modi korrekt.
(defun ils-sensor-pfad (fname)
(ssg-ils-block-datei fname)
)
;; Fuegt einen Sensor-Block wiederholt ein, bis der Benutzer mit
@@ -31,7 +30,7 @@
(setq pfad (ils-sensor-pfad fname))
(if (null pfad)
(princ (strcat "\n>>> FEHLER: Blockdatei '" fname ".dwg' nicht gefunden."
" (in data/ils/3D pruefen)"))
" (in data/ils/<DXFM_DIM> bzw. data/ils/3D pruefen)"))
(progn
(setq oldattreq (getvar "ATTREQ"))
(setvar "ATTREQ" 0)
@@ -187,6 +186,47 @@
(princ)
)
;; ============================================================
;; SSG_DIM_ALL_2D / SSG_DIM_ALL_3D - alle GF/VF-Bloecke der Zeichnung
;; auf einmal in 2D bzw. 3D umwandeln (loeschen + neu aufbauen).
;; ============================================================
(defun ssg-dim-alle-umwandeln (ziel-dim / ss i enames ent bname akt n-gf n-vf n-skip)
;; Feature-Module sicherstellen (Konverter-Funktionen + Bau-Logik)
(if (car (atoms-family 1 '("SSG-ENSURE")))
(progn (ssg-ensure "Gefaellestrecke") (ssg-ensure "VarioFoerderer")))
(setq enames '() n-gf 0 n-vf 0 n-skip 0)
(ssg-start "SSG_DIM_BATCH" '(("OSMODE") ("ATTREQ") ("ATTDIA")))
(setvar "OSMODE" 0)
;; Erst alle enames sammeln (entdel veraendert die Zeichnung waehrend der Iteration)
(setq ss (ssget "X" '((0 . "INSERT") (2 . "GF_*,VF_*"))))
(if ss
(progn
(setq i 0)
(while (< i (sslength ss))
(setq enames (cons (ssname ss i) enames))
(setq i (1+ i)))
(foreach ent enames
(if (entget ent) ; noch vorhanden?
(progn
(setq bname (cdr (assoc 2 (entget ent))))
(setq akt (cond ((ssg-dim-xdata-lesen ent)) ("3D")))
(cond
((equal akt ziel-dim) (setq n-skip (1+ n-skip))) ; schon Zieldim
((wcmatch bname "GF_*")
(if (gf-konvertiere-ent ent ziel-dim) (setq n-gf (1+ n-gf))))
((wcmatch bname "VF_*")
(if (vf-konvertiere-ent ent ziel-dim) (setq n-vf (1+ n-vf))))))))
)
)
(ssg-end)
(princ (ssg-textf "dim-batch-fertig"
(list ziel-dim (itoa n-gf) (itoa n-vf) (itoa n-skip))))
(princ)
)
(defun c:SSG_DIM_ALL_2D ( / ) (ssg-dim-alle-umwandeln "2D"))
(defun c:SSG_DIM_ALL_3D ( / ) (ssg-dim-alle-umwandeln "3D"))
;; ============================================================
;; SSG_SPRACHE - Sprache umschalten (Deutsch/Englisch)
;; Setzt *ssg-lang* live und persistiert ueber DXFM_LANG
+117
View File
@@ -285,6 +285,123 @@
bname
)
;; ------------------------------------------------------------
;; ILS-BLOCKDATEI AUFLOESEN (2D/3D-Umschaltung)
;; ------------------------------------------------------------
;; Aktuell gueltige Dimension ("2D"/"3D") ermitteln, in dieser Reihenfolge:
;; 1) transienter Override *ssg-ils-dim* (fuer gezielten Neubau in EINER
;; Dimension, z.B. Edit-Umschaltung oder Batch-Umwandlung),
;; 2) globaler Modus DXFM_DIM (Default fuer Neubauten),
;; 3) "3D" als Grund-Default.
(defun ssg-ils-dim-aktuell ( / )
(cond
((and (boundp '*ssg-ils-dim*) (= (type *ssg-ils-dim*) 'STR)) *ssg-ils-dim*)
((= (type (getenv "DXFM_DIM")) 'STR) (getenv "DXFM_DIM"))
(t "3D")))
;; Basisverzeichnis der ILS-Bloecke (…/data/ils/) oder nil.
(defun ssg-ils-basis ( / )
(cond
((and (getenv "DXFMAKRO") (= (type (getenv "DXFMAKRO")) 'STR))
(strcat (vl-string-right-trim "/" (vl-string-translate "\\" "/" (getenv "DXFMAKRO")))
"/data/ils/"))
((and (boundp '*ssg-lisp-pfad*) (= (type *ssg-lisp-pfad*) 'STR)
(vl-string-search "/Lisp" *ssg-lisp-pfad*))
(strcat (substr *ssg-lisp-pfad* 1 (vl-string-search "/Lisp" *ssg-lisp-pfad*))
"/data/ils/"))
(t nil)))
;; Liefert den vollstaendigen .dwg-Pfad zu einem ILS-Block anhand der
;; aktuellen Dimension (siehe ssg-ils-dim-aktuell). Faellt automatisch auf die
;; 3D-Variante zurueck, wenn der Block in der aktuellen Dimension (noch) nicht
;; existiert - so nutzen z.B. Vario_Motorstation/-Umlenkstation im 2D-Modus
;; vorlaeufig die 3D-Datei.
;; Rueckgabe: Pfad-String oder nil (Block weder in Dim noch in 3D gefunden).
(defun ssg-ils-block-datei (blockname / basis dim datei datei3d)
(setq basis (ssg-ils-basis))
(if (null basis)
nil
(progn
(setq dim (ssg-ils-dim-aktuell))
(setq datei (strcat basis dim "/" blockname ".dwg"))
(setq datei3d (strcat basis "3D/" blockname ".dwg"))
(cond
((findfile datei) datei) ; aktuelle Dimension
((findfile datei3d) datei3d) ; Fallback: 3D-Variante
(t nil))
)
)
)
;; Merker: welche Dimension ("2D"/"3D") aktuell je Blockname geladen ist.
;; (blockname . dim). Verhindert unnoetiges Neu-Definieren bei gleicher Dim.
(if (not (boundp '*ssg-ils-dim-geladen*)) (setq *ssg-ils-dim-geladen* '()))
;; Stellt sicher, dass die Block-DEFINITION 'blockname' in der AKTUELLEN
;; Dimension geladen ist. Weil 2D- und 3D-Datei denselben Blocknamen tragen,
;; muss bei einem Dimensionswechsel aus der Zieldatei NEU definiert werden -
;; sonst bliebe die alte Definition (z.B. 3D) erhalten.
;; Rueckgabe: T (geladen/vorhanden) oder nil (Datei nicht gefunden).
(defun ssg-ils-block-laden (blockname / dim exists datei temp-obj osm areq adia)
(setq dim (ssg-ils-dim-aktuell))
(setq exists (tblsearch "BLOCK" blockname))
(cond
;; Schon in der gewuenschten Dimension geladen -> nichts tun.
((and exists (equal (cdr (assoc blockname *ssg-ils-dim-geladen*)) dim)) T)
(t
(setq datei (ssg-ils-block-datei blockname))
(if (null datei)
nil
(progn
(if exists
;; Existiert (evtl. andere Dimension) -> aus Datei NEU definieren.
;; "_Y" beantwortet die Redefine-Abfrage; danach wird die eigentliche
;; Einfuegung abgebrochen (die Neudefinition ist bereits wirksam).
(progn
(setq areq (getvar "ATTREQ") adia (getvar "ATTDIA") osm (getvar "OSMODE"))
(setvar "ATTREQ" 0)(setvar "ATTDIA" 0)(setvar "OSMODE" 0)
(command "_.-INSERT" (strcat blockname "=" datei) "_Y")
;; laufende Einfuegung abbrechen (Neudefinition ist bereits wirksam)
(if (> (getvar "CMDACTIVE") 0) (command))
(if (> (getvar "CMDACTIVE") 0) (command))
(setvar "OSMODE" osm)(setvar "ATTREQ" areq)(setvar "ATTDIA" adia))
;; Neu -> bewaehrter COM-Weg (kein Redefine-Prompt).
(progn
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0)) datei 1.0 1.0 1.0 0))
(vla-Delete temp-obj)))
;; Merker aktualisieren (alten Dim-Eintrag dieses Blocks ersetzen).
(setq *ssg-ils-dim-geladen*
(cons (cons blockname dim)
(vl-remove-if (function (lambda (p) (equal (car p) blockname)))
*ssg-ils-dim-geladen*)))
T)))))
;; ------------------------------------------------------------
;; DIMENSIONS-XDATA (2D/3D) je Block - App "SSG_DIM"
;; ------------------------------------------------------------
;; Merkt sich, in welcher Dimension ein GF_/VF_-Block gebaut wurde, damit der
;; Doppelklick-Edit die aktuelle Dimension automatisch erkennen kann. Bewusst
;; getrennt vom fachlichen XDATA/Attributsatz (Export bleibt unveraendert).
(if (null *ssg-dim-xdata-app*) (setq *ssg-dim-xdata-app* "SSG_DIM"))
(defun ssg-dim-xdata-schreiben (ent dim / )
(if (and ent dim)
(progn
(regapp *ssg-dim-xdata-app*)
(entmod
(append (entget ent)
(list (list -3 (list *ssg-dim-xdata-app* (cons 1000 dim))))))))
ent)
;; Rueckgabe: "2D"/"3D" oder nil (kein Eintrag -> Aufrufer nimmt Default 3D).
(defun ssg-dim-xdata-lesen (ent / xd app-data)
(setq xd (entget ent (list *ssg-dim-xdata-app*)))
(setq app-data (cdr (assoc -3 xd)))
(if app-data
(car (mapcar 'cdr (cdr (car app-data))))
nil))
;; ------------------------------------------------------------
;; ATTRIBUT-OPERATIONEN
+8 -16
View File
@@ -247,22 +247,11 @@
;; ============================================================
;; TEIL 5: KS_EIN/KS_AUS EXTRAKTION
;; ============================================================
(defun ensure-block-loaded (blockname / block-datei temp-obj)
(if (not (tblsearch "BLOCK" blockname))
(progn
(setq block-datei (strcat block-pfad blockname ".dwg"))
(if (findfile block-datei)
(progn
(princ (ssg-textf "vfc-lade-block" (list blockname)))
(setq temp-obj (vla-InsertBlock modelspace
(vlax-3D-point '(0 0 0))
block-datei 1.0 1.0 1.0 0))
(vla-Delete temp-obj)
(princ (ssg-text "vfc-status-ok"))
)
(princ (ssg-textf "vfc-fehler-block-datei-fehlt" (list block-datei)))
)
)
(defun ensure-block-loaded (blockname / )
;; Zentraler Loader (aktuelle Dimension + 3D-Fallback, Neudefinition bei
;; Dimensionswechsel). Meldung nur bei Fehlschlag.
(if (not (ssg-ils-block-laden blockname))
(princ (ssg-textf "vfc-fehler-block-datei-fehlt" (list blockname)))
)
)
@@ -1157,6 +1146,9 @@
;; Aufsteigende, eindeutige ID vergeben (wie beim Kreisel), falls verfuegbar.
(if (car (atoms-family 1 '("SSG-ID-GENERATE")))
(ssg-id-generate vf-insert))
;; Dimension (2D/3D) merken -> Doppelklick-Edit erkennt sie automatisch.
(if (car (atoms-family 1 '("SSG-DIM-XDATA-SCHREIBEN")))
(ssg-dim-xdata-schreiben vf-insert (ssg-ils-dim-aktuell)))
(princ (ssg-textf "vfc-block-erstellt-eingefuegt" (list vf-bname)))
vf-insert
)
+71 -8
View File
@@ -716,8 +716,8 @@
;; Rueckgabe: (deltaL deltaH richtung einfuegehoehe hz seite) 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
deltaL deltaH richtung hz seite z-start)
dlg-fahrtrichtung dlg-seite dlg-dimension
deltaL deltaH richtung hz seite z-start dim)
(setq dcl-pfad (strcat (getenv "DXFM_DCL") "/variofoerderer.dcl"))
(setq dat (load_dialog dcl-pfad))
(if (not (new_dialog "variofoerderer_basis" dat))
@@ -763,6 +763,15 @@
(set_tile "seite"
(if (and prefill (equal (cdr (assoc "seite" prefill)) "links")) "1" "0"))
;; Darstellung 2D/3D: Vorbelegung aus prefill "dim" (Edit: erkannte
;; Dimension des Blocks), sonst aktueller Modus (Neuanlage -> i.d.R. 3D).
(start_list "dimension")
(add_list "3D")
(add_list "2D")
(end_list)
(set_tile "dimension"
(if (equal (cond ((cdr (assoc "dim" prefill))) ((ssg-ils-dim-aktuell))) "2D") "1" "0"))
;; Actions
(action_tile "accept"
(strcat
@@ -772,6 +781,7 @@
"(setq dlg-hoehe (get_tile \"einfuegehoehe\"))"
"(setq dlg-fahrtrichtung (get_tile \"fahrtrichtung\"))"
"(setq dlg-seite (get_tile \"seite\"))"
"(setq dlg-dimension (get_tile \"dimension\"))"
"(done_dialog 1)"
)
)
@@ -792,7 +802,8 @@
((= dlg-fahrtrichtung "3") 270.0)
(t 0.0)))
(setq seite (if (= dlg-seite "1") "links" "rechts"))
(list deltaL deltaH richtung z-start hz seite)
(setq dim (if (= dlg-dimension "1") "2D" "3D"))
(list deltaL deltaH richtung z-start hz seite dim)
)
nil
)
@@ -1018,7 +1029,7 @@
;; 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)
z-start hz seite startpunkt startpunkt-xy dim)
(setq startpunkt-xy (getpoint (ssg-text "vfc-prompt-startpunkt-aus")))
(if (null startpunkt-xy) (setq startpunkt-xy '(0 0 0)))
@@ -1031,13 +1042,58 @@
richtung (nth 2 eingabe)
z-start (nth 3 eingabe)
hz (nth 4 eingabe)
seite (nth 5 eingabe))
seite (nth 5 eingabe)
dim (nth 6 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)
(setq *ssg-ils-dim* nil)
)
)
)
;; Nicht-interaktive Umwandlung EINES bestehenden Standard-VF-Blocks in die
;; Zieldimension (fuer die Batch-Umschaltung "Alle auf 2D/3D"). Liest alle
;; Parameter aus XDATA/Attributen (ohne Winkel-Dialog), erzwingt die Zieldim
;; 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)
(setq ed (entget ent) bname (cdr (assoc 2 ed)))
(setq xd (vfs-xdata-lesen ent))
(if (and (wcmatch bname "VF_*") xd (= (car xd) "standard"))
(progn
(setq attribs (ssg-attrib-read ent))
(setq startpunkt (cdr (assoc 10 ed)))
(setq hz (atof (nth 1 xd)))
(setq deltaL (atof (cond ((cdr (assoc "DELTA_L_mm" attribs))) ("0"))))
(setq deltaH (atof (cond ((cdr (assoc "DELTA_H_mm" attribs))) ("0"))))
(setq richtung (cond ((cdr (assoc "ANTRIEBFAHRTRICHTUNG" attribs))) ("Auf")))
(setq seite (cond ((cdr (assoc "SEITE_AS" attribs))) ("rechts")))
(setq best-winkel (atoi (cond ((cdr (assoc "VF_WINKEL" attribs))) ("0"))))
(setq L_GF_m-teile (ssg-cfg-split-comma (cond ((cdr (assoc "L_GF_m" attribs))) ("0.0,0.0"))))
(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")))))
(setq hoehe-von (caddr startpunkt))
(setq hoehe-bis (cond ((= richtung "Auf") (+ hoehe-von deltaH))
((= richtung "Ab") (- hoehe-von deltaH))
(t hoehe-von)))
(setq *ssg-ils-dim* ziel-dim)
(entdel ent)
(setq lastEnt (vf-lastent-ohne-attribute))
(variofoerderer-einfuegen deltaL deltaH richtung best-winkel L_GF1 L_GF2 L_VF startpunkt seite hz)
(setq vf-nummer (vf-next-number))
(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))
(if vf-insert (vfs-xdata-schreiben vf-insert hz))
(setq *ssg-ils-dim* nil)
(if vf-insert T nil))
nil))
;; ============================================================
;; VARIOFOERDERER_EDIT - Doppelklick/Kontextmenue-Bearbeitung
;; ============================================================
@@ -1050,7 +1106,7 @@
;; werden abgewiesen, da ihre Geometrie sich nicht verlustfrei aus dem
;; einfachen Standard-Schema rekonstruieren laesst.
(defun c:VARIOFOERDERER_EDIT ( / ss ent ed bname startpunkt attribs xd
deltaL deltaH richtung z-start hz seite
deltaL deltaH richtung z-start hz seite dim
eingabe vf-nummer best-winkel-attr L_GF_m-teile
prefill-basis prefill-winkel)
;; Implied Selection VOR ssg-start pruefen (ssg-start hebt Selektion auf)
@@ -1091,7 +1147,9 @@
(setq prefill-basis
(list (cons "deltaL" deltaL) (cons "deltaH" deltaH) (cons "richtung" richtung)
(cons "einfuegehoehe" z-start) (cons "hz" hz) (cons "seite" seite)))
(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")))))
(setq eingabe (vfs-dialog-eingabe-basis prefill-basis))
(if (null eingabe)
@@ -1102,7 +1160,8 @@
richtung (nth 2 eingabe)
z-start (nth 3 eingabe)
hz (nth 4 eingabe)
seite (nth 5 eingabe))
seite (nth 5 eingabe)
dim (nth 6 eingabe))
(setq startpunkt (list (car startpunkt) (cadr startpunkt) z-start))
;; Vorbelegung Winkel/Verteilung: bestehenden Winkel vorschlagen, L_GF-
@@ -1115,10 +1174,14 @@
(cons "verteilung-idx" "3")
(cons "lgf1" (* 1000.0 (atof (car L_GF_m-teile))))))
;; Gewaehlte Dimension (2D/3D) fuer den Neubau erzwingen (Override);
;; vf-block-erstellen schreibt sie zugleich neu ins Dim-XDATA.
(setq *ssg-ils-dim* dim)
(entdel ent)
(setq vf-nummer (vf-next-number))
(vfs-standard-dialog-berechnen-einfuegen vf-nummer deltaL deltaH richtung
startpunkt hz seite prefill-winkel)
(setq *ssg-ils-dim* nil)
(princ (ssg-textf "vfs-edit-neu-aufgebaut" (list bname)))
)
)
+5
View File
@@ -44,6 +44,11 @@ gefaellestrecke : dialog {
label = "Fahrtrichtung:";
width = 30;
}
: popup_list {
key = "dimension";
label = "Darstellung (2D/3D):";
width = 20;
}
}
: boxed_row {
+5
View File
@@ -59,6 +59,11 @@ variofoerderer_basis : dialog {
label = "Seite:";
width = 16;
}
: popup_list {
key = "dimension";
label = "Darstellung (2D/3D):";
width = 20;
}
}
}
+1
View File
@@ -445,6 +445,7 @@
"dim-switch-modus": "\nModus umgeschaltet auf: %1",
"dim-switch-blocks": "\n DXFM_BLOCKS = %1",
"dim-switch-omniflo": "\n DXFM_OMNIFLO = %1",
"dim-batch-fertig": "\nUmwandlung auf %1 abgeschlossen: %2 GF, %3 VF neu aufgebaut (%4 bereits in Zieldimension).",
"sprache-gewechselt": "\nSprache umgeschaltet auf: %1",
"cmd-block-auswaehlen": "\nBlock auswaehlen: ",
"cmd-kein-block-ausgewaehlt": "\nKein Block ausgewaehlt.",
+1
View File
@@ -445,6 +445,7 @@
"dim-switch-modus": "\nMode switched to: %1",
"dim-switch-blocks": "\n DXFM_BLOCKS = %1",
"dim-switch-omniflo": "\n DXFM_OMNIFLO = %1",
"dim-batch-fertig": "\nConversion to %1 complete: %2 GF, %3 VF rebuilt (%4 already in target dimension).",
"sprache-gewechselt": "\nLanguage switched to: %1",
"cmd-block-auswaehlen": "\nSelect block: ",
"cmd-kein-block-ausgewaehlt": "\nNo block selected.",
+52 -28
View File
@@ -627,78 +627,90 @@
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00132">
<Macro>
<Name>Alle Bloecke auf 2D</Name>
<Command>^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_ALL_2D</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00133">
<Macro>
<Name>Alle Bloecke auf 3D</Name>
<Command>^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_ALL_3D</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00134">
<Macro>
<Name>Sprache</Name>
<Command>^C^C(ssg-ensure "SSG_LIB_Commands") SSG_SPRACHE</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00135">
<MenuMacro UID="MM_00137">
<Macro>
<Name>Alle Tests ausfuehren</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_run_all.lsp")) SSG_RUN_ALL_TESTS</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00137">
<MenuMacro UID="MM_00139">
<Macro>
<Name>Kreisel</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_kreisel.lsp")) TEST_KREISEL</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00138">
<MenuMacro UID="MM_00140">
<Macro>
<Name>Foerderer</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_foerderer.lsp")) TEST_FOERDERER</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00139">
<MenuMacro UID="MM_00141">
<Macro>
<Name>Foerderer-Linienzug</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_linienzug.lsp")) TEST_LINIENZUG</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00140">
<MenuMacro UID="MM_00142">
<Macro>
<Name>Omniflo</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_omniflo.lsp")) TEST_OMNIFLO</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00141">
<MenuMacro UID="MM_00143">
<Macro>
<Name>Gefaellestrecke</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_gefaellestrecke.lsp")) TEST_GEFAELLESTRECKE</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00142">
<MenuMacro UID="MM_00144">
<Macro>
<Name>Export CSV/Sivas ALL</Name>
<Command>^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_export_all.lsp")) TEST_EXPORT_ALL</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00154">
<MenuMacro UID="MM_00156">
<Macro>
<Name>Kreisel bearbeiten</Name>
<Command>(ssg-ensure "KreiselInsert") KreiselEdit</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00155">
<MenuMacro UID="MM_00157">
<Macro>
<Name>Omniflo Element bearbeiten</Name>
<Command>(ssg-ensure "OmniModulInsert") OMNI_EDIT</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00156">
<MenuMacro UID="MM_00158">
<Macro>
<Name>Gefaellestrecke bearbeiten</Name>
<Command>(ssg-ensure "Gefaellestrecke") GEFAELLESTRECKE_EDIT</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00157">
<MenuMacro UID="MM_00159">
<Macro>
<Name>VarioFoerderer bearbeiten</Name>
<Command>(ssg-ensure "VarioFoerderer") VARIOFOERDERER_EDIT</Command>
</Macro>
</MenuMacro>
<MenuMacro UID="MM_00159">
<MenuMacro UID="MM_00161">
<Macro>
<Name>SSG Bearbeiten (Auto)</Name>
<Command>(ssg-ensure "SSG_LIB_Commands") SSG_BLOCKEDIT</Command>
@@ -717,7 +729,7 @@
<PopMenuRef pUID="PM_00045"/>
<PopMenuRef pUID="PM_00127"/>
<PopMenuRef pUID="PM_00130"/>
<PopMenuRef pUID="PM_00134"/>
<PopMenuRef pUID="PM_00136"/>
</PopMenu>
<PopMenu UID="PM_00005">
<Name>ILS</Name>
@@ -1407,11 +1419,23 @@
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Sprache</NameRef>
<NameRef>Alle Bloecke auf 2D</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00132"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Alle Bloecke auf 3D</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00133"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Sprache</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00134"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Konfiguration Schliessen</NameRef>
<MenuItem>
@@ -1419,84 +1443,84 @@
</MenuItem>
</PopMenuItem>
</PopMenu>
<PopMenu UID="PM_00134">
<PopMenu UID="PM_00136">
<Name>Tests</Name>
<PopMenuItem>
<NameRef>Alle Tests ausfuehren</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00135"/>
<MacroRef MenuMacroID="MM_00137"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem IsSeparator="true"/>
<PopMenuItem>
<NameRef>Kreisel</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00137"/>
<MacroRef MenuMacroID="MM_00139"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Foerderer</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00138"/>
<MacroRef MenuMacroID="MM_00140"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Foerderer-Linienzug</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00139"/>
<MacroRef MenuMacroID="MM_00141"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Omniflo</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00140"/>
<MacroRef MenuMacroID="MM_00142"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Gefaellestrecke</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00141"/>
<MacroRef MenuMacroID="MM_00143"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Export CSV/Sivas ALL</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00142"/>
<MacroRef MenuMacroID="MM_00144"/>
</MenuItem>
</PopMenuItem>
</PopMenu>
<PopMenu UID="PM_00153">
<PopMenu UID="PM_00155">
<Alias>POP501</Alias>
<Name>SSG_LIB Edit Context</Name>
<PopMenuItem>
<NameRef>Kreisel bearbeiten</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00154"/>
<MacroRef MenuMacroID="MM_00156"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Omniflo Element bearbeiten</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00155"/>
<MacroRef MenuMacroID="MM_00157"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>Gefaellestrecke bearbeiten</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00156"/>
<MacroRef MenuMacroID="MM_00158"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem>
<NameRef>VarioFoerderer bearbeiten</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00157"/>
<MacroRef MenuMacroID="MM_00159"/>
</MenuItem>
</PopMenuItem>
<PopMenuItem IsSeparator="true"/>
<PopMenuItem>
<NameRef>SSG Bearbeiten (Auto)</NameRef>
<MenuItem>
<MacroRef MenuMacroID="MM_00159"/>
<MacroRef MenuMacroID="MM_00161"/>
</MenuItem>
</PopMenuItem>
</PopMenu>
+2
View File
@@ -129,6 +129,8 @@
[<-Export CSV]^C^C(ssg-ensure "export") EXPORTCSV
[->Konfiguration]
[Umschalten 2D und 3D]^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_SWITCH
[Alle Bloecke auf 2D]^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_ALL_2D
[Alle Bloecke auf 3D]^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_ALL_3D
[Sprache]^C^C(ssg-ensure "SSG_LIB_Commands") SSG_SPRACHE
[<-Konfiguration Schliessen]^C^C
[->Tests]