- (defun c:tt (/ en1 en2 pjdl enRegion0 enRegion1 enRegion2 ss)
- (if
- (and
- (setq en1 (car (entsel "\n 选择第一个多段线:")))
- (setq en2 (car (entsel "\n 选择第二个多段线:")))
- )
- (progn
- (setq pjdl (vlax-invoke
- (vlax-ename->vla-object en1)
- 'IntersectWith
- (vlax-ename->vla-object en2)
- acExtendNone))
- (if (and pjdl (> (length pjdl) 3))
- (progn
- (command ".region" en1 "")
- (setq enRegion1 (entlast))
- (command ".region" en2 "")
- (setq enRegion2 (entlast))
- (command ".union" enRegion1 enRegion2 "")
- (setq enenRegion0 (entlast))
- (command ".Explode" enenRegion0)
- (setq ss (ssget "p"))
- (command "pedit" "m" ss "" "y" "j" "" "")
- )
- )
- )
- )
- )
|