- (defun c:tt ()
- (defun Mid2Pt (p1 p2)(mapcar '(lambda (x y) (* (+ x y) 0.5)) p1 p2))
- (defun PlinePtn (e)(mapcar 'cdr (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget e))))
- (while (setq s1 (car (entsel "\n选择矩形: ")))
- (if (= (length (setq ptn (PlinePtn s1))) 4)
- (progn
- (mapcar 'set '(p1 p2 p3 p4) ptn)
- (if (> (distance p1 p2) (distance p2 p3))
- (command "line" (Mid2Pt p1 p4) (Mid2Pt p2 p3) "")
- (command "line" (Mid2Pt p1 p2) (Mid2Pt p4 p3) "")
- )
- )
- )
- )
- (xyp-End)
- )
|