ATTREQ/ATTDIA vor GF-Block-Insert auf 0 setzen, um fehlende Attribute zu beheben; Horizontale Variofoerderer-Mittelsektion als zusaetzlichen Testfall in TEST_FOERDERER pruefen und bauen
This commit is contained in:
@@ -1484,8 +1484,15 @@
|
|||||||
)
|
)
|
||||||
;; Block definieren und einfuegen
|
;; Block definieren und einfuegen
|
||||||
(setq gf-bname (strcat "GF_" (itoa gf-nummer)))
|
(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).
|
||||||
|
(setvar "ATTREQ" 0)
|
||||||
|
(setvar "ATTDIA" 0)
|
||||||
(command "_.-BLOCK" gf-bname startpunkt gf-ss "")
|
(command "_.-BLOCK" gf-bname startpunkt gf-ss "")
|
||||||
(command "_.INSERT" gf-bname startpunkt 1.0 1.0 0.0)
|
(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
|
||||||
(setq gf-insert (entlast))
|
(setq gf-insert (entlast))
|
||||||
(ssg-attrib-set-on gf-insert
|
(ssg-attrib-set-on gf-insert
|
||||||
|
|||||||
+75
-25
@@ -66,16 +66,44 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
;; --- Einen VF-Testblock bauen und lastEnt hinter dessen SEQEND schieben ---
|
||||||
|
(defun foerderer:baue-block (startpunkt vf-nummer hoehe-von hoehe-bis
|
||||||
|
deltaH deltaL richtung best-winkel
|
||||||
|
L_GF1 L_GF2 L_VF lastEnt /
|
||||||
|
sub-ent)
|
||||||
|
(variofoerderer-einfuegen deltaL deltaH richtung best-winkel
|
||||||
|
L_GF1 L_GF2 L_VF
|
||||||
|
startpunkt "links" 0.0)
|
||||||
|
(vf-block-erstellen "standard" "links" vf-nummer 0
|
||||||
|
hoehe-von hoehe-bis deltaH deltaL L_VF
|
||||||
|
L_GF1 L_GF2
|
||||||
|
richtung best-winkel startpunkt lastEnt 0.0)
|
||||||
|
;; lastEnt hinter den SEQEND des VF-Blocks schieben.
|
||||||
|
;; Ohne diesen Schritt wuerde entnext vom INSERT-Entity
|
||||||
|
;; in die ATTRIB-Kette des gerade erstellten VF-Blocks
|
||||||
|
;; springen und diese beim naechsten _.-BLOCK-Aufruf
|
||||||
|
;; in den neuen Block verschieben (Datenverlust).
|
||||||
|
(setq lastEnt (entlast))
|
||||||
|
(setq sub-ent (entnext lastEnt))
|
||||||
|
(while (and sub-ent
|
||||||
|
(not (equal (cdr (assoc 0 (entget sub-ent))) "SEQEND")))
|
||||||
|
(setq lastEnt sub-ent)
|
||||||
|
(setq sub-ent (entnext lastEnt)))
|
||||||
|
(if sub-ent (setq lastEnt sub-ent))
|
||||||
|
lastEnt
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
;; C:TEST_FOERDERER - Hauptbefehl
|
;; C:TEST_FOERDERER - Hauptbefehl
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
(defun c:TEST_FOERDERER ( / json-datei testdaten cfg tests
|
(defun c:TEST_FOERDERER ( / json-datei testdaten cfg tests
|
||||||
eintrag test-id richtung deltaL deltaH
|
eintrag test-id richtung deltaL deltaH
|
||||||
ergebnis best-winkel L_GF L_VF
|
ergebnis best-winkel L_GF L_VF horizontal-info
|
||||||
y-offset y-abstand idx
|
y-offset y-abstand idx blk-nummer
|
||||||
anz-gebaut anz-nicht-gebaut results-list
|
anz-gebaut anz-nicht-gebaut results-list
|
||||||
startpunkt vf-nummer hoehe-von hoehe-bis lastEnt
|
startpunkt hoehe-von hoehe-bis lastEnt
|
||||||
sub-ent sub-typ)
|
sub-typ)
|
||||||
|
|
||||||
;; Bibliothek initialisieren (laedt Block-Library und extrahiert Masse)
|
;; Bibliothek initialisieren (laedt Block-Library und extrahiert Masse)
|
||||||
(if (not *lib-initialized*)
|
(if (not *lib-initialized*)
|
||||||
@@ -113,6 +141,7 @@
|
|||||||
|
|
||||||
(setq y-offset 0)
|
(setq y-offset 0)
|
||||||
(setq idx 0)
|
(setq idx 0)
|
||||||
|
(setq blk-nummer 0)
|
||||||
(setq results-list '())
|
(setq results-list '())
|
||||||
(setq anz-gebaut 0)
|
(setq anz-gebaut 0)
|
||||||
(setq anz-nicht-gebaut 0)
|
(setq anz-nicht-gebaut 0)
|
||||||
@@ -160,33 +189,17 @@
|
|||||||
" L_VF=" (rtos L_VF 2 1)))
|
" L_VF=" (rtos L_VF 2 1)))
|
||||||
|
|
||||||
(setq startpunkt (list 0 y-offset 0))
|
(setq startpunkt (list 0 y-offset 0))
|
||||||
(setq vf-nummer idx)
|
(setq blk-nummer (1+ blk-nummer))
|
||||||
(setq hoehe-von 0)
|
(setq hoehe-von 0)
|
||||||
(setq hoehe-bis (if (= richtung "Auf") deltaH (- deltaH)))
|
(setq hoehe-bis (if (= richtung "Auf") deltaH (- deltaH)))
|
||||||
;; Wie c:VarioFoerderer: Attribut-Entities/SEQEND des vorherigen
|
;; Wie c:VarioFoerderer: Attribut-Entities/SEQEND des vorherigen
|
||||||
;; VF_N-Blocks ueberspringen, sonst rutschen sie in den naechsten
|
;; VF_N-Blocks ueberspringen, sonst rutschen sie in den naechsten
|
||||||
;; Block hinein (Blockerstellung faengt sonst am falschen Entity an).
|
;; Block hinein (Blockerstellung faengt sonst am falschen Entity an).
|
||||||
(setq lastEnt (vf-lastent-ohne-attribute))
|
(setq lastEnt (vf-lastent-ohne-attribute))
|
||||||
(variofoerderer-einfuegen deltaL deltaH richtung best-winkel
|
(setq lastEnt
|
||||||
(/ L_GF 2.0) (/ L_GF 2.0) L_VF
|
(foerderer:baue-block startpunkt blk-nummer hoehe-von hoehe-bis
|
||||||
startpunkt "links" 0.0)
|
deltaH deltaL richtung best-winkel
|
||||||
(vf-block-erstellen "standard" "links" vf-nummer 0
|
(/ L_GF 2.0) (/ L_GF 2.0) L_VF lastEnt))
|
||||||
hoehe-von hoehe-bis deltaH deltaL L_VF
|
|
||||||
(/ L_GF 2.0) (/ L_GF 2.0)
|
|
||||||
richtung best-winkel startpunkt lastEnt 0.0)
|
|
||||||
|
|
||||||
;; lastEnt hinter den SEQEND des VF-Blocks schieben.
|
|
||||||
;; Ohne diesen Schritt wuerde entnext vom INSERT-Entity
|
|
||||||
;; in die ATTRIB-Kette des gerade erstellten VF-Blocks
|
|
||||||
;; springen und diese beim naechsten _.-BLOCK-Aufruf
|
|
||||||
;; in den neuen Block verschieben (Datenverlust).
|
|
||||||
(setq lastEnt (entlast))
|
|
||||||
(setq sub-ent (entnext lastEnt))
|
|
||||||
(while (and sub-ent
|
|
||||||
(not (equal (cdr (assoc 0 (entget sub-ent))) "SEQEND")))
|
|
||||||
(setq lastEnt sub-ent)
|
|
||||||
(setq sub-ent (entnext lastEnt)))
|
|
||||||
(if sub-ent (setq lastEnt sub-ent))
|
|
||||||
|
|
||||||
(setq results-list (cons
|
(setq results-list (cons
|
||||||
(foerderer:test-result-json test-id richtung deltaL deltaH
|
(foerderer:test-result-json test-id richtung deltaL deltaH
|
||||||
@@ -202,6 +215,43 @@
|
|||||||
results-list))
|
results-list))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; Zusaetzlich: Horizontale Variofoerderer-Mittelsektion (0 Grad)
|
||||||
|
;; pruefen und als eigenen Testfall bauen, falls bei richtung="Ab"
|
||||||
|
;; geometrisch moeglich (analog Schritt 5b in c:VarioFoerderer).
|
||||||
|
(if (= richtung "Ab")
|
||||||
|
(progn
|
||||||
|
(setq horizontal-info (berechne-horizontale-mitte deltaL deltaH "Ab"))
|
||||||
|
(if (and horizontal-info (caddr horizontal-info))
|
||||||
|
(progn
|
||||||
|
(setq anz-gebaut (1+ anz-gebaut))
|
||||||
|
(princ (strcat "\n " (itoa idx) ". " test-id
|
||||||
|
" -> GEBAUT (Horizontale Variofoerderer 0"
|
||||||
|
(chr 176) ") L_GF=" (rtos (car horizontal-info) 2 1)
|
||||||
|
" L_VF=" (rtos (cadr horizontal-info) 2 1)))
|
||||||
|
|
||||||
|
(setq y-offset (- y-offset y-abstand))
|
||||||
|
(setq startpunkt (list 0 y-offset 0))
|
||||||
|
(setq blk-nummer (1+ blk-nummer))
|
||||||
|
(setq hoehe-von 0)
|
||||||
|
(setq hoehe-bis (- deltaH))
|
||||||
|
(setq lastEnt (vf-lastent-ohne-attribute))
|
||||||
|
(setq lastEnt
|
||||||
|
(foerderer:baue-block startpunkt blk-nummer hoehe-von hoehe-bis
|
||||||
|
deltaH deltaL "Ab" 0
|
||||||
|
(/ (car horizontal-info) 2.0)
|
||||||
|
(/ (car horizontal-info) 2.0)
|
||||||
|
(cadr horizontal-info) lastEnt))
|
||||||
|
|
||||||
|
(setq results-list (cons
|
||||||
|
(foerderer:test-result-json (strcat test-id "_HORIZONTAL") richtung
|
||||||
|
deltaL deltaH "GEBAUT" 0
|
||||||
|
(car horizontal-info) (cadr horizontal-info))
|
||||||
|
results-list))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(setq y-offset (- y-offset y-abstand))
|
(setq y-offset (- y-offset y-abstand))
|
||||||
|
|||||||
Reference in New Issue
Block a user