Hi all,
I have a acThumb.ocx and it works fine on 32 bits AutoCAD 2008.
Now I need to have the same functionality in 64 bits in AutoCAD 2008.
I have read all the forum threads around and there were examples like this one :
http://forums.autodesk.com/t5/NET/Save-preview-to-file/m-p/1351983
and this one :
http://forums.autodesk.com/t5/NET/block-image/td-p/1476488
and here :
http://www.caddzone.com/BlockIconSample.zip
... and more.
The problem is that Tonys http://www.caddzone.com/BlockIconSample.zip works fine when the block is already inside the current dwg. I tried to modfiy the db like this: (but it does not work)
[code]
// this - does not work
Database db = new Database(false, true);
string sourceDrawing = "C:\\134160.dwg";
db.ReadDwgFile(sourceDrawing, System.IO.FileShare.Read, true, "");
//instead of this which works fine
//Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;
[/code]
The DWG is WBLOCK-created block and I suppose that it does not have preview before loading into MDIActiveDocument. I want to gets its preview witho
Old acThumb.ocx does the work, but I cant find a way to do this in AutoCAD 2008 in 64 bits.
Can you help me with a suggestion or code?
Solved! Go to Solution.
Solved by ognyandim. Go to Solution.
Try
Database db = new Database(false, false);/////When you set to true associating this database to the current document
db.ReadDwgFile("C:\\134160.dwg",FileOpenMode.OpenForReadAndReadShare, False, ""); /// This should not really matter
Bitmap bitmp = db.ThumbnailBitmap