[原创]删重复:线,点,文本,块
<p>(princ "\n命令:scf")<br/>(defun c:scf ()<br/> (sfff "lwpolyline")<br/> (sfff "line")<br/> (sfff "point")<br/> (sfff "text")<br/> (sfff "insert")</p><p>)<br/>(defun sfff (ffff)<br/> (setvar "cmdecho" 0)<br/> (setvar "osmode" 0)<br/> (command "convertpoly" "l" "all" "")<br/> <br/> (setq aa (ssget "x" (list (cons 0 ffff))))<br/> (if aa<br/> (progn</p><p> (setq len1 (sslength aa)<br/> n 0<br/> )<br/> (repeat len1<br/> (setq aa1 (ssname aa n))<br/> (setq n (+ n 1))<br/> (setq bb (entget aa1 '("*")))<br/> (setq zb1 (cdr (assoc 10 bb)))<br/> (setq tc (cdr (assoc 8 bb)))<br/> (setq jb1 (cdr (assoc 5 bb)))<br/> (setq w100 (assoc 100 bb))<br/> (setq w101 (member w100 bb))</p><p> (setq px1 (car zb1)<br/> py1 (cadr zb1)<br/> )<br/> (setq px2 (- px1 5)<br/> px3 (+ px1 5)<br/> )<br/> (setq py2 (- py1 5)<br/> py3 (+ py1 5)<br/> )<br/> (setq pn2 (list px2 py2)<br/> pn3 (list px3 py3)<br/> )<br/> (command "zoom" "c" pn2 20)<br/> (setq ls-s (ssget "c" pn2 pn3 (list (cons 0 ffff) (cons 8 tc))))<br/> (if ls-s<br/> (progn<br/> (setq lens (sslength ls-s)<br/> ns 0<br/> )<br/> (if (> lens 1)<br/> (progn<br/> (repeat lens<br/> (setq aas (ssname ls-s ns))<br/> (setq ns (+ ns 1))<br/> (setq wbb (entget aas '("*")))<br/> (setq jb2 (cdr (assoc 5 wbb)))<br/> (setq ww100 (assoc 100 wbb))<br/> (setq ww101 (member ww100 wbb))<br/> (if (/= jb1 jb2)<br/> (progn<br/> (if (= (equal w101 ww101) t)<br/> (command "erase" aa1 "")<br/> )<br/> )<br/> )<br/> )</p><p> )</p><p> ) ;if (> lens 1)<br/> )<br/> ) ;if ls-s</p><p> ) ;repeat len1<br/> )<br/> )<br/> (command "convertpoly" "h" "all" "")</p><p>)</p> 我正好 要这个程序非常感谢 回复 gao6690 的帖子能框选最好了 删除不掉重线,效果不好
页:
[1]