明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2184|回复: 6

请教:如何判断一组由line,arc,pline相连接的对象是否构成了闭合区域?

[复制链接]
发表于 2005-12-30 15:03 | 显示全部楼层 |阅读模式
如何判断一组由line,arc,pline相连接的对象是否构成了闭合区域?谢谢!
发表于 2005-12-30 23:01 | 显示全部楼层
region
 楼主| 发表于 2005-12-31 10:14 | 显示全部楼层

除了用能否生成region来判断外,是否还有其它方法?谢谢!

发表于 2006-1-1 02:14 | 显示全部楼层

用这个函数试试吧

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;加载后运行ei
(defun c:ei()
  (initget 1)
  (setq SS (ssget ":S"))   ;选择实体;Creates a selection set from the selected object
  (vl-load-com)
  (setq N 0)
  (repeat (sslength SS)  ;repeat :循环  ;sslength :Returns an integer containing the number of objects (entities) in a selection set
 (princ (strcat "\n" (itoa n) "\n"))
 (if (vlax-curve-isClosed (vlax-ename->vla-object (ssname SS N)))
  (princ "封闭实体")
  (princ "非封闭实体")
 )
 ;;;(princ (entget (ssname SS N)))   ;SSNAME   : Returns the object (entity) name of the indexed element of a selection set
    (setq N (1+ N))
  ) ;end repeat
  (princ "\n加载后运行ei\n")
  (princ)
)

 楼主| 发表于 2006-1-4 10:06 | 显示全部楼层

首先谢谢楼上的答复!我的问题是由多个line,pline,arc首尾相连是否构成了一个闭合区域。

 楼主| 发表于 2006-1-4 18:46 | 显示全部楼层
请版本帮忙,谢谢!
发表于 2006-1-4 21:23 | 显示全部楼层
  1. (DEFUN C:TT()
  2. (SETQ SS(ssget '((0 . "LINE,ARC,*polyline"))))
  3. (command "pedit" "m" SS "" )
  4. (IF (WCMATCH (cdr(assoc 0 (entget (ssname ss 0)))) "LINE,ARC")
  5.      (COMMAND "Y")
  6. )
  7. (COMMAND "j" "")
  8. (setq e (entlast))
  9. (equal (vlax-curve-getstartpoint e)(vlax-curve-getendpoint e) 1e-4)
  10. )


您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-30 19:37 , Processed in 0.316705 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表