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

Urgent: How to Extract ole file names from dwg file

114 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 (114 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;

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community