怎么遍历DBDictionary 对象?
DBDictionary acDBDicNOD = acTrans.GetObject(acDatabase.NamedObjectsDictionaryId, OpenMode.ForRead) as DBDictionary;
现在相对Autocad中的字典数据进行遍历,但是DBDictionary 的Keys、Values为受保护对象,无法直接访问;
DbDictionaryEnumerator acDBDicEnumerator = acDBDicNOD.GetEnumerator();
当使用枚举时会抛出异常,提示无效的对象操作。
求高手字典
DBDictionary dbDictionary
using (Transaction ctrans = smc.db.TransactionManager.StartTransaction())
{
DBObject dbObj;
foreach (System.Collections.DictionaryEntry dEntry in dbDictionary)
{
dbObj = (DBObject)ctrans.GetObject((ObjectId)dEntry.Value, OpenMode.ForRead, false);
if (dbObj is DBDictionary)
{
}
else if (dbObj is Xrecord)
{
} 问题解决了,感激不尽
页:
[1]