I am attempting to use the ReleaseExtensionDictionary method. When I call it, it does not throw an error in my test environment the processing simply stops. When stepping through the code it simply exits, no error nothing! I am a newbie with ACAD.net, so I may be overlooking something obvious...
Windows 8.1 x64, VS 2013 & AutoCAD 2015
Database db = HostApplicationServices.WorkingDatabase;
RegAppTableRecord ratRec;
using (Transaction tr = db.TransactionManager.StartTransaction()) {
// Open the Registered Applications table for read
RegAppTable rat = tr.GetObject(db.RegAppTableId, OpenMode.ForWrite) as RegAppTable;
foreach (ObjectId id in rat) { // find our reg app name
ratRec = tr.GetObject(id, OpenMode.ForWrite) as RegAppTableRecord;
if (ratRec.Name == APPNAME) {
/*
DBDictionary xdict = (DBDictionary)tr.GetObject(ratRec.ExtensionDictionary, OpenMode.ForWrite);
if (xdict != null && xdict.Contains(PROJECTID)) {
Xrecord xr = (Xrecord)tr.GetObject((ObjectId)xdict[PROJECTID], OpenMode.ForWrite);
xr.Erase(true);
}
*/
ratRec.ReleaseExtensionDictionary(); //<- blows up here!!!!!!!
break;
}
}
tr.Commit();
}
Thank you! 🙂
Does that blow up all the time, or only when calling this on an object that has no extension dictionary? Does it blow up for an empty extension dictionary, or only for ones that contain dictionary entries? And what is the context in which your code is running?
What is displayed in your debug output window when it "blows up"?