|
代码:
Using Trans As Transaction = DB.TransactionManager.StartTransaction
Dim groupDict As DBDictionary = Trans.GetObject(DB.GroupDictionaryId, OpenMode.ForWrite)
For Each Ent As DBDictionaryEntry In groupDict
If Ent.Key.Substring(0, 1) = "*" Then
Dim grpObj As Group = Trans.GetObject(groupDict.GetAt(ent.Key), OpenMode.ForWrite)
grpObj.Erase()
End If
Next
Trans.Commit()
End Using
上面的代码可以正常运行,不过有点遗憾的是,速度比较慢,删除下面测试文件中的匿名组约需30分钟这样,如果用lisp方法删除,只要5分钟左右。各位高手能否支个招,看怎样删除能提高其速度??
测试文件
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |
|