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
+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)))
)
)