交点断开
帮忙看看这个程序,能不能改成多次执行,回车后结束。(defun c:text (/ osm oc ol pt1 ss len i entn a ct ra la)<BR> (setq temperr *error*)<BR> (setq *error* trap1)<BR> (setq oc (getvar "cmdecho"))<BR> (setq ol (getvar "clayer"))<BR> (setq osm (getvar "osmode"))<BR> (setvar "cmdecho" 0)<BR> (setvar "osmode" 32)<BR> (setq pt1 (getpoint "\n选择需断开的交点:"))<BR> (if (null pt1) (alert "没发现交点!")<BR> (progn<BR> (setq ss (ssget "C" (list (- (car pt1) 1) (- (cadr pt1) 1)) (list (+ (car pt1) 1) (+ (cadr pt1) 1))))<BR> (setq len (sslength ss))<BR> (setq i 0)<BR> (while (< i len)<BR> (setq entn (ssname ss i))<BR> (setq a (entget entn))<BR> (if (or (= (cdr (assoc 0 a)) "LINE") (= (cdr (assoc 0 a)) "ARC")<BR> (= (cdr (assoc 0 a)) "CIRCLE") (= (cdr (assoc 0 a)) "POLYLINE")<BR> )<BR> (progn<BR> (setvar "osmode" 0)<BR> (if (= (cdr (assoc 0 a)) "CIRCLE")<BR> (progn<BR> (setq ct (cdr (assoc 10 a)))<BR> (setq ra (cdr (assoc 40 a)))<BR> (setq la (cdr (assoc 8 a)))<BR> (entdel entn)<BR> (command "layer" "s" la "")<BR> (command "arc" "c" ct pt1 (polar pt1 (angle pt1 ct) (* 2 ra)))<BR> (command "arc" "c" ct (polar pt1 (angle pt1 ct) (* 2 ra)) pt1)<BR> )<BR> (command "break" (list entn pt1) "f" pt1 "@")<BR> )<BR> )<BR> )<BR> (setq i (+ i 1))<BR> )<BR> )<BR> )<BR> (setvar "osmode" osm)<BR> (command "layer" "s" ol "")<BR> (setvar "cmdecho" oc)<BR> (princ) <BR>)<BR> 我把CIRCLE部分去掉了,你自己再添进去吧。。。
(defun c:test (/ osm pt1 ss i entn ty)<BR> (setq temperr *error*)<BR> (setq *error* trap1)<BR> (setq osm (getvar "osmode"))<BR> (setvar "cmdecho" 0)<BR> (setvar "osmode" 32)<BR> <BR> (while (setq pt1 (getpoint "\n选择需断开的交点:"))<BR> (setq ss (ssget "C" pt1 pt1))<BR> (setq i 0)<BR> (while (< i (sslength ss))<BR> (setq entn (ssname ss i))<BR> (setq ty (cdr (assoc 0 (entget entn))))<BR> (cond<BR> ((or (= ty "LINE") (= ty "POLYLINE") (= ty "ARC") (= ty "LWPOLYLINE") (= ty "SPLINE"))<BR> (command "_.break" (list entn pt1) "f" pt1 "@")<BR> )<BR> )<BR> (setq i (+ i 1))<BR> )<BR> )<BR> (setvar "osmode" osm)<BR> (princ) <BR>) 这个帖子或许能给你帮助
<A href="http://www.xdcad.net/forum/showthread.php?s=&threadid=162614" target="_blank" >http://www.xdcad.net/forum/showthread.php?s=&threadid=162614</A> 可以框选吗 没人来讨论吗,好期待出现好工具啊
页:
[1]