请教:如何判断一组由line,arc,pline相连接的对象是否构成了闭合区域?
如何判断一组由line,arc,pline相连接的对象是否构成了闭合区域?谢谢! region <P>除了用能否生成region来判断外,是否还有其它方法?谢谢!</P> <P>用这个函数试试吧</P><P>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;加载后运行ei<BR>(defun c:ei()<BR> (initget 1)<BR> (setq SS (ssget ":S")) ;选择实体;Creates a selection set from the selected object<BR> (vl-load-com)<BR> (setq N 0) <BR> (repeat (sslength SS) ;repeat :循环 ;sslength :Returns an integer containing the number of objects (entities) in a selection set <BR> (princ (strcat "\n" (itoa n) "\n"))<BR> (if (vlax-curve-isClosed (vlax-ename->vla-object (ssname SS N)))<BR> (princ "封闭实体")<BR> (princ "非封闭实体")<BR> )<BR> ;;;(princ (entget (ssname SS N))) ;SSNAME : Returns the object (entity) name of the indexed element of a selection set<BR> (setq N (1+ N)) <BR> ) ;end repeat<BR> (princ "\n加载后运行ei\n")<BR> (princ) <BR>)<BR></P> <P>首先谢谢楼上的答复!我的问题是由多个line,pline,arc首尾相连是否构成了一个闭合区域。</P> 请版本帮忙,谢谢! (DEFUN C:TT()
(SETQ SS(ssget '((0 . "LINE,ARC,*polyline"))))
(command "pedit" "m" SS "" )
(IF (WCMATCH (cdr(assoc 0 (entget (ssname ss 0)))) "LINE,ARC")
(COMMAND "Y")
)
(COMMAND "j" "")
(setq e (entlast))
(equal (vlax-curve-getstartpoint e)(vlax-curve-getendpoint e) 1e-4)
)
页:
[1]