立即注册 登录
晓东CAD家园-论坛 返回首页

eachy的个人空间 http://bbs.xdcad.net/?14 [收藏] [复制] [分享] [RSS]

日志

检测 Lwpolyline 自交叉的函数

已有 776 次阅读2013-5-6 18:12 |个人分类:Lisp

                                   

原贴地址: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)
)

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

QQ|申请友链|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.

返回顶部