用这个函数试试吧
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;加载后运行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) )
|