.NET

Reply
Valued Contributor
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 1 of 4 (626 Views)
Accepted Solution

Preview of outside DWG in AutoCAD 2008 64 bits

626 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
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 2 of 4 (591 Views)

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
Jeffrey_H
Posts: 372
Registered: ‎01-20-2010
Message 3 of 4 (583 Views)

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
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 4 of 4 (538 Views)

Re: Preview of outside DWG in AutoCAD 2008 64 bits

11-15-2010 02:33 AM in reply to: ognyandim
Announcements
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 or visit the Installation and Licensing Forum to get help installing your software.