Hier ist der Code:
(Defun c:spirett)
(Sectq x1 0);
(seq y1 0)
(Sectq x2 0)
(seq y2 0) ;;
(Sectq x3 0);
(seq y3 0)
(Sectq x4 0)
(seq y4 0)
(Sectq x5 0);
(seq y5 0) ;;
(Sectq x6 0);
(seq y6 0) ;;
(setq d1 0); variable Initialisierung
(seq d2 0)
(Abschnitt 0) ;;
(Sectq kmax 0);
(setq nmax 0);
(Sectq k 0)
(Abschnitt 0);
(Sectq cl 0)
(Sectq ps 0);
(Abschnitt 0);
(Sectq r 0);
(Sekt 0)
(Sectq d1)
(setq d2 (getdist "height:"));
(seq Schritt (getreal "Schritt definieren:");
(setq ps (getpoint "angeben Startpunkt:"));
(setq kmax (min d1 d2);
(Befehl "_pline");
(Liste Schritt für Schritt) ;;
(Liste(* 2 Schritt) Schritt;
(Liste(* 2 Schritt) 0;
(list(* 3 Schritt) 0); erstellt Schließkanten
(Liste (* 3 Schritt) (* 2 Schritt));
(Liste 0 (* 2 Schritt));
(Liste 0 0 0)
;
(Sectq cl (entlast) ;;
(Sectq p1 ps)
(Sectq x1 (Auto p1);
(Sectq y1 (cadr p1);
(setq x2 (+ d1 x1))
(setq y2 (+ d2 y1)
(Setq x3 (+ x1(* 2 Schritt));
(setq y3 (+ y1 (* 2 Schritt));
(setq p1 (list x1 y1)
(setq p2 (list x1 y2);
(setq p3 (list x2 y2);; externe Atempunkte
(setq p4 (list x2 y1)
(setq p5 (list x3 y1)
(setq p6 (list x3 y3);
(setq pf p3) ;; Endpunkt für die Auswahl Rechteck
(Befehl "_pline" p1 p2 p3 p4 p5 p6");
(setq a (entlast)
(Setq x1 x3);
(seq y1 y3);
(Sectq x2 (- x2 (* 2 Schritt));
(setq y2 (- y2 (* 2 Schritt));
(setq x3 (+ x3(* 2 Schritt));
(Satz y3 (+ y3));
(Setq k (* 4 Schritt));
(Während);
(- kmax k) (* 4 Schritt)
(setq p1 (list x1 y1)
(setq p2 (list x1 y2);
(Setq p3 (Liste x2 y2);
(setq p4 (list x2 y1)
(setq p5 (list x3 y1)
(setq p6 (list x3 y3);
;;
(Befehl "_pline" p1 p2 p3 p4 p5 p6");; es führt Spulen aus, bis es Platz gibt
;;
(Setq x1 x3);
(seq y1 y3);
(Sectq x2 (- x2 (* 2 Schritt));
(setq y2 (- y2 (* 2 Schritt));
(setq x3 (+ x3(* 2 Schritt));
(Satz y3 (+ y3));
(setq k (+ k) ;;
)
(setq sset (ssget "_c" ps pf));
(Befehl "_join" zu sset)
;; führt dasselbe Verfahren zur Rückgabe mit einem Offset aus, der dem Schritt entspricht
(setq nmax (- kmax (* 2 Schritt)))
(Setq d3 (- d1 (* 2 Schritt)))
(setq d4 (- d2 (* 2 Schritt)))
(setq x7 (+ (car ps) Schritt))
(setq y7 (+ (cadr ps) Schritt))
(Setq x8 (+ d3 x7))
(setq y8 (+ d4 y7))
(Setq x9 (+ x7 (* 2 Schritt))))
(setq y9 (+ y7 (* 2 Schritt)))
(setq p7 (list x7 y7))
(setq p8 (list x7 y8))
(Setq p9 (Liste x8 y8))
(setq p10 (list x8 y7))
(setq p11 (list x9 y7))
(setq p12 (list x9 y9)
(Befehl "_pline" p7 p9 p10 p11 p12 ")
(setq r (entlast)
(Setq x7 x9)
(Setq y7 y9)
(Setq x8 (- x8 (* 2 Schritt)))
(setq y8 (- y8 (* 2 Schritt)))
(Setq x9 (+ x9 (* 2 Schritt))))
(setq y9 (+ y9 (* 2 Schritt))))
(Setq n (* 4 Schritt)
(sing)
(* 4 Schritt)
(setq p7 (list x7 y7))
(setq p8 (list x7 y8))
(Setq p9 (Liste x8 y8))
(setq p10 (list x8 y7))
(setq p11 (list x9 y7))
(setq p12 (list x9 y9)
(Befehl "_pline" p7 p9 p10 p11 p12 ")
(Setq x7 x9)
(Setq y7 y9)
(Setq x8 (- x8 (* 2 Schritt)))
(setq y8 (- y8 (* 2 Schritt)))
(Setq x9 (+ x9 (* 2 Schritt))))
(setq y9 (+ y9 (* 2 Schritt))))
(setq n (+ n* 4 Schritt))
)
(setq sset (ssget "_c" ps pf))
(Befehl "_join" r sset)
(falls (> x1 x7);
(Befehl "_move" cl "0,0" p12);
(Befehl "_move" cl "0,0" p6);; legen Sie die Schließkante
;
(Befehl "_join" cl r");
)
Ich entschuldige mich vorab für meine rohe moooooooolto Programmierung

Ich bin leider selbstsüchtig