eigenes Menü zum Einfügen eines neuen Kreisels und zum Verbinden
This commit is contained in:
+29
-6
@@ -71,13 +71,12 @@
|
|||||||
(+ (cadr lstart) (* tval dy)))
|
(+ (cadr lstart) (* tval dy)))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Linien-Endpunkte aus LINE-Entity lesen. Rueckgabe: ((sx sy) (ex ey))
|
;; Linien-Endpunkte aus LINE-Entity lesen. Rueckgabe: ((sx sy sz) (ex ey ez))
|
||||||
(defun kreisel-get-line-pts (ent / ed p10 p11)
|
(defun kreisel-get-line-pts (ent / ed p10 p11)
|
||||||
(setq ed (entget ent))
|
(setq ed (entget ent))
|
||||||
(setq p10 (cdr (assoc 10 ed))
|
(setq p10 (cdr (assoc 10 ed))
|
||||||
p11 (cdr (assoc 11 ed)))
|
p11 (cdr (assoc 11 ed)))
|
||||||
(list (list (car p10) (cadr p10))
|
(list p10 p11)
|
||||||
(list (car p11) (cadr p11)))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Pruefen ob zwei Richtungsvektoren parallel sind
|
;; Pruefen ob zwei Richtungsvektoren parallel sind
|
||||||
@@ -180,10 +179,12 @@
|
|||||||
|
|
||||||
;; --- Block erzeugen (Entities werden aus Zeichnung entfernt) ---
|
;; --- Block erzeugen (Entities werden aus Zeichnung entfernt) ---
|
||||||
(setq bname (strcat "KR_" (ssg-make-blockname
|
(setq bname (strcat "KR_" (ssg-make-blockname
|
||||||
(list (car basePoint) (cadr basePoint) 0.0))))
|
(list (car basePoint) (cadr basePoint)
|
||||||
|
(if (caddr basePoint) (caddr basePoint) 0.0)))))
|
||||||
(command "_.-BLOCK" bname (list 0.0 0.0 0.0) ss "")
|
(command "_.-BLOCK" bname (list 0.0 0.0 0.0) ss "")
|
||||||
|
|
||||||
;; --- Block am Zielpunkt einfuegen (ohne Attribut-Dialog) ---
|
;; --- Block am Zielpunkt einfuegen (ohne Attribut-Dialog) ---
|
||||||
|
;; basePoint kann 2D oder 3D sein; INSERT uebernimmt die Z-Koordinate
|
||||||
(setq oldAttreq (getvar "ATTREQ"))
|
(setq oldAttreq (getvar "ATTREQ"))
|
||||||
(setq oldAttdia (getvar "ATTDIA"))
|
(setq oldAttdia (getvar "ATTDIA"))
|
||||||
(setvar "ATTREQ" 0)
|
(setvar "ATTREQ" 0)
|
||||||
@@ -260,6 +261,7 @@
|
|||||||
lpts1 lpts2 s1 e1 s2 e2
|
lpts1 lpts2 s1 e1 s2 e2
|
||||||
dir1 dir2 snap1 foot
|
dir1 dir2 snap1 foot
|
||||||
dx dy dist abstand rotation typ
|
dx dy dist abstand rotation typ
|
||||||
|
z1s z1e z2s z2e zCoord zTol
|
||||||
ok msg)
|
ok msg)
|
||||||
|
|
||||||
(ssg-start "Kreisel Smart Connect" '(("OSMODE") ("CECOLOR")))
|
(ssg-start "Kreisel Smart Connect" '(("OSMODE") ("CECOLOR")))
|
||||||
@@ -314,6 +316,26 @@
|
|||||||
(if (not (kreisel-parallel-p dir1 dir2))
|
(if (not (kreisel-parallel-p dir1 dir2))
|
||||||
(setq ok nil msg "Linien sind nicht parallel!")
|
(setq ok nil msg "Linien sind nicht parallel!")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; Z-Koordinaten pruefen (alle 4 Endpunkte muessen gleiche Hoehe haben)
|
||||||
|
(if ok
|
||||||
|
(progn
|
||||||
|
(setq z1s (caddr s1) z1e (caddr e1)
|
||||||
|
z2s (caddr s2) z2e (caddr e2))
|
||||||
|
;; Fehlende Z-Werte als 0 behandeln
|
||||||
|
(if (null z1s) (setq z1s 0.0))
|
||||||
|
(if (null z1e) (setq z1e 0.0))
|
||||||
|
(if (null z2s) (setq z2s 0.0))
|
||||||
|
(if (null z2e) (setq z2e 0.0))
|
||||||
|
(setq zTol 0.1)
|
||||||
|
(if (or (> (abs (- z1s z1e)) zTol)
|
||||||
|
(> (abs (- z2s z2e)) zTol)
|
||||||
|
(> (abs (- z1s z2s)) zTol))
|
||||||
|
(setq ok nil msg "Start und Ziel auf ungleicher Hoehe!")
|
||||||
|
(setq zCoord z1s)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -353,8 +375,9 @@
|
|||||||
" Rotation: " (rtos rotation 2 1) " Grad"
|
" Rotation: " (rtos rotation 2 1) " Grad"
|
||||||
" Kreiselart: " typ))
|
" Kreiselart: " typ))
|
||||||
|
|
||||||
;; Modul als Compound-Block einfuegen
|
;; Modul als Compound-Block einfuegen (mit Z-Koordinate)
|
||||||
(draw-module snap1 abstand rotation
|
(draw-module (list (car snap1) (cadr snap1) zCoord)
|
||||||
|
abstand rotation
|
||||||
(list (cons "KREISELART" typ)))
|
(list (cons "KREISELART" typ)))
|
||||||
|
|
||||||
(princ "\nKreisel Connect erfolgreich!")
|
(princ "\nKreisel Connect erfolgreich!")
|
||||||
|
|||||||
+2
-1
@@ -4,7 +4,8 @@
|
|||||||
[SSG_LIB]
|
[SSG_LIB]
|
||||||
[->ILS]
|
[->ILS]
|
||||||
[->Kreisel-Module]
|
[->Kreisel-Module]
|
||||||
[Kreisel]^C^CKreiselInsert
|
[Einfuegen]^C^CKreiselInsert
|
||||||
|
[Verbinden]^C^CKreiselConnect
|
||||||
[<-Eckrad]^C^CILS_Eckrad
|
[<-Eckrad]^C^CILS_Eckrad
|
||||||
[->Zusatzmodul]
|
[->Zusatzmodul]
|
||||||
[BTMT-Beladung]^C^CILS_BTMT_Beladung
|
[BTMT-Beladung]^C^CILS_BTMT_Beladung
|
||||||
|
|||||||
Reference in New Issue
Block a user