;(setq ss1 (ssget "x")) ;;**
(setq ss (ssget '((0 . "LWPOLYLINE"))) i 0)
(repeat (sslength ss)
(setq ssn (ssname ss i))
(setvar "qaflags" 1)
(command "ucs" "ob" ssn)
;(commandssn)
(command ".explode" ssn "")
(setvar "qaflags" 0)
;(setq ssn_e (COMMAND "SELECT" "P" ""))
(command "_region" "p" "")
(command "_erase" "P" "")
(setq i (1+ i))
) ;;repeat
;(setq ss2 (ssget "x")) ;;**
;(setq ss3 (th-ssdiff ss2 (th-ssdiff ss1 ss)));;**
;(command "select" ss3 "") ;;**
(command "_.ucs" "")
(princ)
)
;;; 两选择集的差集
;;; ==================================================================
(defun th-ssdiff (ss1 ss2)
(command "select" ss1 "r" ss2 "")
(ssget "P")
)
;;; ==================================================================
;;; 两选择集的联集
;;; ==================================================================
(defun th-ssunion (ss1 ss2)
(command "select" ss1 ss2 "")
(ssget "P")
) 依序运行程序,文字中间的多线段可消除,期待高手优化程序! http://bbs.mjtd.com/thread-171466-1-1.html
页:
1
[2]