;;高手不在,菜鸟在 (defun c:tt (/ p1 p2 p e) (if (and (setq p1 (getpoint "\n第一点: ")) (setq p4 (getpoint p1 "\n第二点: ")) ) (progn (setq mp (mapcar '(lambda (a b) (/ (+ a b) 2)) p1 p4)) (if (apply '> (mapcar '(lambda (a b) (abs (- a b))) p1 p4)) (setq p2 (cons (car mp) (cdr p1)) p3 (cons (car mp) (cdr p4)) ) (setq p2 (cons (car p1) (cdr mp)) p3 (cons (car p4) (cdr mp)) ) ) (command "_.pline" "_non" p1 "_non" p2 "_non" mp "_non" p3 "_non" p4 "") (setq e (entlast)) (command "_.pedit" e "_spl" "") ) ) ) |