.NET

.NET

Reply
Valued Contributor
59 Posts
0 Kudos
Registered: ‎05-21-2008
Post 1 of 4
Accepted Solution

Preview of outside DWG in AutoCAD 2008 64 bits

632 Views, 3 Replies
11-09-2010 04:32 AM

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?

Valued Contributor
59 Posts
0 Kudos
Registered: ‎05-21-2008
Post 2 of 4

Re: Preview of outside DWG in AutoCAD 2008 64 bits

11-10-2010 12:41 AM in reply to: ognyandim

Does anybody have an idea about this issue?

Valued Mentor
372 Posts
13 Kudos
Registered: ‎01-20-2010
Post 3 of 4

Re: Preview of outside DWG in AutoCAD 2008 64 bits

11-10-2010 01:49 AM 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
Valued Contributor
59 Posts
0 Kudos
Registered: ‎05-21-2008
Post 4 of 4

Re: Preview of outside DWG in AutoCAD 2008 64 bits

11-15-2010 02:33 AM in reply to: ognyandim
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!