- 积分
- 15341
- 明经币
- 个
- 注册时间
- 2002-2-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-6-14 17:13:00
|
显示全部楼层
试试看,临时改的,可能不行….
试试看,临时改的,可能不行….
(defun CINES (/ SS1 SS2 SS3 SSL PTS AOBJ1 AOBJ2 N1 N2 IPTS A N NN
HOLDOSMODE
)
(vl-load-com)
(command "_.UNDO" "_GROUP")
(setq HOLDOSMODE (getvar "OSMODE"))
(setvar "OSMODE" 0)
(prompt "\n选择要断开的线:")
(setq SS1 (ssget '((0 . "*LINE,ARC"))))
(prompt "\n选择用于断开的界线:")
(setq SS2 (ssget '((0 . "*LINE,ARC"))))
(command "_.SELECT" SS1 SS2 "")
(setq SS (ssget ""))
(setq N1 0
SSL (sslength SS)
)
(while (< N1 (1- SSL))
(setq AOBJ1 (ssname SS N1)
AOBJ1 (vlax-ename->vla-object AOBJ1)
N2 (1+ N1)
)
(while (< N2 SSL)
(setq AOBJ2 (ssname SS N2)
AOBJ2 (vlax-ename->vla-object AOBJ2)
IPTS (vla-intersectwith
AOBJ1
AOBJ2
0
)
IPTS (vlax-variant-value IPTS)
)
(if (> (vlax-safearray-get-u-bound IPTS 1) 0)
(progn
(setq IPTS
(vlax-safearray->list IPTS)
)
(while (> (length IPTS) 0)
(setq PTS (cons (list (car IPTS)
(cadr IPTS)
(caddr IPTS)
)
PTS
)
IPTS (cdddr IPTS)
)
)
)
)
(setq N2 (1+ N2))
)
(setq N1 (1+ N1))
)
(setq N 0)
(repeat (length PTS)
(setq A (ssget "C" (nth N PTS) (nth N PTS)))
(setq SS3 (ssadd))
(setq N1 0)
(repeat (sslength A)
(if (not (ssmemb (ssname A N1) SS2))
(ssadd (ssname A N1) SS3)
)
(setq N1 (1+ N1))
)
(setq A SS3)
(setq NN 0)
(repeat (sslength A)
(command "_.BREAK" (ssname A NN) (nth N PTS) (nth N PTS))
(setq NN (1+ NN))
)
(setq N (1+ N))
)
(setvar "OSMODE" HOLDOSMODE)
(command "_.UNDO" "_END")
(princ)
) |
|