Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to update the .SourceFileName of the RasterImageDef object I have but when I try an exception is thrown by AutoCAD which is:
eFileAccessErr - 'Autodesk.AutoCAD.Runtime.Exception' occurred in AcdbMgd.dll but was not handled in user code
The code is below, any suggestions to stop the exception - Currently working with A2015 but installing A2017 to test as well.
using (Transaction transaction = database.TransactionManager.StartTransaction()) { ObjectId imageDictionaryId = RasterImageDef.GetImageDictionary(database); if (!imageDictionaryId.IsNull) { DBDictionary dBDictionary = transaction.GetObject(imageDictionaryId, OpenMode.ForRead) as DBDictionary; foreach (DBDictionaryEntry entry in dBDictionary) { RasterImageDef rasterImageDef = transaction.GetObject(entry.Value, OpenMode.ForWrite) as RasterImageDef; if (rasterImageDef != null) { // rasterImageDef.UpgradeOpen(); rasterImageDef.SourceFileName = "dawson.tif"; } } transaction.Commit(); } }
Solved! Go to Solution.