这样的功能,早就有了。
下面的程序由网络收集,版权归原作者。。。
(defun c:miaotu (/ p1 p2 lst setucs) (defun err-new (msg)
(command "._redraw") (princ msg) (ended) ) ;;;________________________________ (defun ended (/ tmp) (setq *error* err-old) (if setucs (command "_.ucs" "p") ) ) (setq err-old *error*) (setq *error* err-new) (princ "\nWRITEN BY WKAI , XDCAD.NET , 20040611") (setvar "ORTHOMODE" 0) (setvar "cmdecho" 1) (if (setq p1 (getpoint "\n指定第一点:")) (if (setq p2 (getpoint p1 "\n指定下一点:")) (progn (setq p1 (trans p1 1 0)) (setq p2 (trans p2 1 0)) (entmake (list (cons 0 "LINE") (cons 10 P1) (cons 11 P2))) (command "_.ucs" "ob" (entlast)) (setq setucs t) (entdel (entlast)) (setvar "ORTHOMODE" 1) (command "_.pline" (trans p1 0 1) (trans p2 0 1)) (while (/= (getvar "cmdactive") 0) (command pause) ) (command) ) ) ) (ended) ) |