Valued Contributor
Posts: 86
Registered: ‎07-22-2006
Message 1 of 2 (116 Views)

Urgent: How to Extract ole file names from dwg file

116 Views, 1 Replies
12-28-2006 04:34 AM
Dear All,
There is a dwg file on disk which have some ole objects. I need to extract ole file names and paths from this Dwg file through programming. Has anybody an idea?

Posts: 5
Registered: ‎08-11-2008
Message 2 of 2 (116 Views)

Re: Urgent: How to Extract ole file names from dwg file

03-04-2009 06:40 AM in reply to: aslam
Autodesk.AutoCAD.DatabaseServices.ObjectId imgDictID = RasterImageDef.GetImageDictionary(db);
DBDictionary imgDict;
if (imgDictID.OldId == 0)
imgDictID = RasterImageDef.CreateImageDictionary(db);

// test the image dictionary and the raster before going further

Autodesk.AutoCAD.DatabaseServices.ObjectId TestImgDictID = RasterImageDef.GetImageDictionary(db);
imgDict = (DBDictionary)trans.GetObject(imgDictID, OpenMode.ForRead, false);

foreach (DBDictionaryEntry def2 in imgDict)

RasterImageDef rasterDef = (RasterImageDef)trans.GetObject(def2.Value, OpenMode.ForRead, false);
string jpegFilename = rasterDef.SourceFileName;
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.