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

Preview of outside DWG in AutoCAD 2008 64 bits

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
ognyandim
951 Views, 3 Replies

Preview of outside DWG in AutoCAD 2008 64 bits

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?

3 REPLIES 3
Message 2 of 4
ognyandim
in reply to: ognyandim

Does anybody have an idea about this issue?

Message 3 of 4
Jeffrey_H
in reply to: ognyandim

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

You can also find your answers @ TheSwamp
Message 4 of 4
ognyandim
in reply to: ognyandim

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