3D-Linienzug (gemischte Gefaellestrecke/VarioFoerderer-Kette, Modus 1: manuelle Eingabe) wurde bei Variofoerder gabaut. Die Block-Attribute für GF und VF wurde angepasst wie erfoerdert bei EXPORT.

This commit is contained in:
2026-07-06 15:54:46 +02:00
parent acdf735e00
commit 9ce739fb35
6 changed files with 1217 additions and 153 deletions
+62 -58
View File
@@ -146,12 +146,19 @@
(setq ks-results '())
(setq sub-entities (vlax-invoke block-obj 'Explode))
(foreach sub-obj sub-entities
(if (and (not (vlax-erased-p sub-obj))
(= (vla-get-ObjectName sub-obj) "AcDbBlockReference")
(or (= (vla-get-Name sub-obj) "KS_EIN")
(= (vla-get-Name sub-obj) "KS_AUS")))
;; KS-Blocknamen normalisieren: aeltere Bloecke nutzen KS_EIN/KS_AUS,
;; Vario_Kurve-Bloecke KSYS_EIN/KSYS_AUS (inline, damit diese Fallback-
;; Kopie unabhaengig von vf_core.lsp funktioniert).
(setq ks-ref
(if (and (not (vlax-erased-p sub-obj))
(= (vla-get-ObjectName sub-obj) "AcDbBlockReference"))
(cond
((or (= (vla-get-Name sub-obj) "KS_EIN") (= (vla-get-Name sub-obj) "KSYS_EIN")) "KS_EIN")
((or (= (vla-get-Name sub-obj) "KS_AUS") (= (vla-get-Name sub-obj) "KSYS_AUS")) "KS_AUS")
(t nil))
nil))
(if ks-ref
(progn
(setq ks-ref (vla-get-Name sub-obj))
(setq inner-entities (vlax-invoke sub-obj 'Explode))
(setq origin nil x-end nil y-end nil z-end nil)
(foreach inner-obj inner-entities
@@ -1334,7 +1341,8 @@
bL90 bL60 bL30
bR90 bR60 bR30
startpunkt last-ent nach-aus-pt entry-hz
(caddr (nth first-idx segmente)))
(caddr (nth first-idx segmente))
es-seite)
(princ "\n\n=========================================")
(princ "\n>>> Fertig! <<<")
@@ -1348,49 +1356,25 @@
;; TEIL 4.5: GF-BLOCK-SYSTEM (Nummerierung, Label, Attribute)
;; ============================================================
;; Attribut-Definitionen fuer GF_N-Bloecke
(setq *gf-attrib-defs*
'(("NUMMER" "0")
("TYP" "standard")
("SEITE" "rechts")
("MONTAGEHOEHE_m" "0.000")
("HOEHE_VON" "0")
("HOEHE_BIS" "0")
("DELTA_H" "0")
("DELTA_L" "0")
("L_GF_m" "0.000")
("WINKEL" "0.000")
("ANZAHL_SEPARATOR" "0")
("ANZAHL_SCANNER" "0")
("GF_Bogen_L_90" "0")
("GF_Bogen_L_60" "0")
("GF_Bogen_L_30" "0")
("GF_Bogen_R_90" "0")
("GF_Bogen_R_60" "0")
("GF_Bogen_R_30" "0")
("ID" "")
)
)
;; Attribut-Definitionen fuer GF_N-Bloecke kommen aus dem gemeinsamen
;; Strecken-Schema in ssg_core.lsp (ssg-strecke-attrib-defs). TYP wird zur
;; Laufzeit bestimmt: ohne Bogen -> "Gefaellestrecke" (reduziert), mit Bogen
;; -> "Streckengruppe" (voll).
;; Naechste freie GF-Nummer
;; Stufe 1: NUMMER-Attribut aller GF_*-Inserts lesen
;; Stufe 2: Block-Tabelle pruefen GF_N darf noch nicht als Definition existieren
(defun gf-next-number ( / ss i nr maxnr attribs)
(defun gf-next-number ( / ss i nr maxnr bname)
(setq maxnr 0)
(setq ss (ssget "X" '((0 . "INSERT") (2 . "GF_*"))))
(if ss
(progn
(setq i 0)
(while (< i (sslength ss))
(setq attribs (ssg-attrib-read (ssname ss i)))
(foreach pair attribs
(if (= (car pair) "NUMMER")
(progn
(setq nr (atoi (cdr pair)))
(if (> nr maxnr) (setq maxnr nr))
)
)
)
;; Nummer aus dem Blocknamen GF_<n> ableiten ("GF_" = 3 Zeichen)
(setq bname (cdr (assoc 2 (entget (ssname ss i)))))
(setq nr (atoi (substr bname 4)))
(if (> nr maxnr) (setq maxnr nr))
(setq i (1+ i))
)
)
@@ -1456,13 +1440,31 @@
L-gf-str winkel n-separator n-scanner
bogen-L90 bogen-L60 bogen-L30
bogen-R90 bogen-R60 bogen-R30
startpunkt last-ent nach-aus-pt entry-hz L-first-seg /
gf-bname gf-ss ent gf-insert)
startpunkt last-ent nach-aus-pt entry-hz L-first-seg
es-seite /
gf-bname gf-ss ent gf-insert typ-str anzahl-gf
gf-winkel-str i)
;; 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)
;; ATTDEFs (unsichtbar, am Startpunkt)
(foreach def *gf-attrib-defs*
;; TYP: mit Bogen -> "Streckengruppe"; ohne Bogen (einsegmentig) ->
;; "Gefaellestrecke" (reduzierter Attributsatz, siehe ssg-strecke-attrib-defs).
(setq typ-str
(if (> (+ bogen-L90 bogen-L60 bogen-L30 bogen-R90 bogen-R60 bogen-R30) 0)
"Streckengruppe" "Gefaellestrecke"))
(setq gf-bname (strcat "GF_" (itoa gf-nummer)))
;; Anzahl GF-Segmente = Anzahl kommagetrennter Werte in L-gf-str;
;; GF_WINKEL parallel dazu (alle Segmente teilen die Gefaelle-Neigung).
(setq anzahl-gf 1 i 1)
(while (<= i (strlen L-gf-str))
(if (= (substr L-gf-str i 1) ",") (setq anzahl-gf (1+ anzahl-gf)))
(setq i (1+ i)))
(setq gf-winkel-str (rtos (float winkel) 2 1) i 1)
(while (< i anzahl-gf)
(setq gf-winkel-str (strcat gf-winkel-str "," (rtos (float winkel) 2 1)))
(setq i (1+ i)))
;; ATTDEFs (unsichtbar, am Startpunkt) nach gemeinsamem Strecken-Schema
(foreach def (ssg-strecke-attrib-defs typ-str)
(entmake
(list '(0 . "ATTDEF")
(cons 10 startpunkt)
@@ -1482,42 +1484,43 @@
(ssadd ent gf-ss)
(setq ent (entnext ent))
)
;; Block definieren und einfuegen
(setq gf-bname (strcat "GF_" (itoa gf-nummer)))
;; ATTREQ/ATTDIA=0: verhindert interaktive Attribut-Abfrage bei INSERT
;; (sonst bleiben die per ssg-attrib-set-on gesetzten Werte wirkungslos,
;; da INSERT auf der Kommandozeile auf Attribut-Eingaben wartet), siehe
;; identisches Muster in vf-block-erstellen (vf_core.lsp).
;; Block definieren und einfuegen (ATTREQ/ATTDIA=0: keine interaktive Abfrage)
(setvar "ATTREQ" 0)
(setvar "ATTDIA" 0)
(command "_.-BLOCK" gf-bname startpunkt gf-ss "")
(command "_.INSERT" gf-bname startpunkt 1.0 1.0 0.0)
(setvar "ATTREQ" 1)
;; Attribute auf das eingefuegte INSERT-Objekt setzen
;; Attribute auf das eingefuegte INSERT-Objekt setzen (volle Werteliste;
;; nicht vorhandene Tags ignoriert ssg-attrib-set-on -> reduzierter Satz ok).
(setq gf-insert (entlast))
(ssg-attrib-set-on gf-insert
(list
(cons "NUMMER" (itoa gf-nummer))
(cons "TYP" typ)
(cons "SEITE" seite)
(cons "Bezeichnung" gf-bname)
(cons "MONTAGEHOEHE_m" "0.000")
(cons "HOEHE_VON" (itoa (fix hoehe-von)))
(cons "HOEHE_BIS" (itoa (fix hoehe-bis)))
(cons "DELTA_H" (itoa (fix (abs deltaH))))
(cons "DELTA_L" (itoa (fix deltaL)))
(cons "TYP" typ-str)
(cons "SEITE_AS" seite)
(cons "SEITE_ES" es-seite)
(cons "ANZAHL_GF" (itoa anzahl-gf))
(cons "L_GF_m" L-gf-str)
(cons "WINKEL" (rtos (float winkel) 2 3))
(cons "ANZAHL_SEPARATOR" (itoa n-separator))
(cons "ANZAHL_SCANNER" (itoa n-scanner))
(cons "GF_WINKEL" gf-winkel-str)
(cons "GF_Bogen_L_90" (itoa bogen-L90))
(cons "GF_Bogen_L_60" (itoa bogen-L60))
(cons "GF_Bogen_L_30" (itoa bogen-L30))
(cons "GF_Bogen_R_90" (itoa bogen-R90))
(cons "GF_Bogen_R_60" (itoa bogen-R60))
(cons "GF_Bogen_R_30" (itoa bogen-R30))
(cons "ANZAHL_SEPARATOR" (itoa n-separator))
(cons "ANZAHL_SCANNER" (itoa n-scanner))
)
)
(princ (strcat "\n>>> GF-Block erstellt: " gf-bname))
;; Aufsteigende, eindeutige ID vergeben (wie beim Kreisel), falls verfuegbar.
(if (car (atoms-family 1 '("SSG-ID-GENERATE")))
(ssg-id-generate gf-insert))
(princ (strcat "\n>>> GF-Block erstellt: " gf-bname " (" typ-str ")"))
gf-insert
)
@@ -1612,7 +1615,8 @@
winkel
1 0
0 0 0 0 0 0
startpunkt last-ent nach-aus-pt (float hz) (float L_stau)))
startpunkt last-ent nach-aus-pt (float hz) (float L_stau)
es-seite))
(princ "\n\n=========================================")
(princ "\n>>> Gefaellestrecke erfolgreich eingefuegt! <<<")