本帖最后由 作者 于 2008-7-8 13:09:34 编辑
(setq groups (vla-get-groups (vla-get-activedocument(vlax-get-acad-object)))) ;;清除空组 (defun test1 () (vlax-for obj groups (if (zerop (vla-get-count obj)) (vla-delete obj)) ) ) 你说的删掉的意思是将对象脱离编组吧?? (defun test2 (GroupName enLst) (vla-RemoveItems (vla-item groups GroupName) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray 9 (cons 0 (1- (length enlst)))) (mapcar 'vlax-ename->vla-object enlst) ) ) ) ) |