|
原贴地址:http://www.xdcad.net/forum/showthread.php?s=&postid=2941562#post2941562
只写了 lwpolyline 不包括 polyline
;;对 Pline 线检测自交叉, T 交叉,nil ok
(defun checkpl (e / tf n obj nn tf0)
;;(if (setq e (car (entsel)))
;;(progn
(setq tf (vlax-curve-isclosed e)
n (cdr (assoc 90 (entget e)))
obj (vlax-ename->vla-object e)
)
(setq nn (/ (1+ (vlax-safearray-get-u-bound
(variant-value (vla-intersectwith obj obj 0))
1
)
)
3
)
)
(if tf
(setq tf0 (= n nn))
(setq tf0 (= (- n 2) nn))
)
;; )
;;)
;;(if (not tf0)
;; (princ "\n自交叉!")
;; (princ "\nOk!")
;;)
;;(princ)
(not tf0)
)
|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园
( 辽ICP备15016793号 )
GMT+8, 2025-9-4 17:28 , Processed in 0.162463 second(s), 24 queries , Gzip On.
Powered by Discuz! X3.5
© 2001-2025 Discuz! Team.