.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ReleaseExtensionDictionary blows up!

2 REPLIES 2
Reply
Message 1 of 3
johan_p
352 Views, 2 Replies

ReleaseExtensionDictionary blows up!

 

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! 🙂

 

Earthbound Corp.
IT Dev/Ops Mgr.
Johan Pinrgree
2 REPLIES 2
Message 2 of 3
StephenPreston
in reply to: johan_p

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?

Cheers,

Stephen Preston
Autodesk Developer Network
Message 3 of 3

What is displayed in your debug output window when it "blows up"?

--
Owen Wengerd
ManuSoft

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost