(defun C:XALIGN(/ satz 0-0-0 p1 p2 p3 q1 q2 q3 hl1 hl2 hl3 ep2 ep3) ;scj.schulz@t-online.de (setq 0-0-0 (list 0 0 0)) (prompt"\nSelect Elements: ") (setq satz (ssget)) (command "_UCS" "_W") (setq P1 (getpoint "\nSELECT Startpoint 1: ")) (command "_point" p1) (setq Q1 (getpoint "\nSELECT Targetpoint 1: ")) (command "_point" q1) (command "_line" p1 q1 "") (setq hl1 (entlast)) (setq P2 (getpoint "\nSelect Startpoint 2: ")) (command "_point" p2) (setq ep2 (entlast)) (setq Q2 (getpoint "\nSELECT Targetpoint 2")) (command "_point" q1) (command "_line" p2 q2 "") (setq hl2 (entlast)) (setq P3 (getpoint "\nSelect Startpoint 3: ")) (command "_point" p3) (setq ep3 (entlast)) (setq Q3 (getpoint "\nSELECT Targetpoint 3")) (command "_point" q3) (command "_line" p3 q3 "") (setq hl3 (entlast)) (command "_move" satz ep2 ep3 "" p1 q1) (command "_erase" hl1 hl2 hl3 "") (setq p2 (cdr (assoc 10 (entget ep2)))) (command "_ucs" "_3p" q1 q2 p2) (command "_rotate" satz ep3 "" 0-0-0 "_R" 0-0-0 (trans p2 0 1) (trans q2 0 1)) (command "_UCS" "_w") (command "_ucs" "_ZA" q2 q1) (setq p3 (trans (cdr (assoc 10 (entget ep3))) 0 1)) (command "_rotate" satz "" 0-0-0 "_R" 0-0-0 p3 (trans q3 0 1)) (command "_erase" ep2 ep3 "") (command "_UCS" "_W") (princ) ); end xalign.lsp