本帖最后由 作者 于 2008-11-4 15:51:37 编辑
(defun c:mjtd(/ setmode ss i mode) (cmdbe) (princ"\n程序功能:快速剪掉多段线内或外的对象") (if mode mode (setq mode "内部")) (setq setmode t) (while setmode (princ (strcat "\n当前剪切模式是:" mode)) (setq ss (ko-ssget (strcat "\n选择对象或[设置剪切环境(S)<" mode ">]:") "S" '((0 . "*polyline")))) (cond ((= ss "S") (setq mode (settrimmode mode)) ) ((= (type ss) 'PICKSET) (trimmainprogram ss) (setq setmode nil) ) ((= ss nil) (setq setmode nil) ) ) ) (cmde) (princ) ) (defun trimmainprogram(ss / i lst ena) (command "._zoom" "o" ss "") (setq i 0) (repeat (sslength ss) (setq ena (ko-convert-pline (ssname ss i))) (cond ((= mode "内部") (setq lst (ko-get->list-offsetpline ena t 3)) (command "._trim" ena "" "f") (foreach x lst (command "non" x)) (command (car lst) "" "") ) ((= mode "外部") (setq lst (ko-get->list-offsetpline ena nil 3)) (command "._trim" ena "" "f") (foreach x lst (command "non" x)) (command (car lst) "" "") ) ) (setq i (1+ i)) ) (command "._zoom" "p") ) (defun settrimmode(mode / value) (initget "V Q") (setq value (getkword (strcat "\n[内部(V)/外部(Q)<" mode ">]:"))) (cond ((= value "V") (setq value "内部")) ((= value nil) (setq value mode)) ((= value "Q") (setq value "外部")) ) value ) ;;;;借用了飞哥的上面的一颗奔腾CPU8核心处理器 来改装把我的程序一下, ;;;;多谢谢飞哥哥啦 |