.NET

Reply
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 1 of 8 (1,393 Views)
Accepted Solution

Dwg thumbnail view using .Net

1393 Views, 7 Replies
03-01-2012 05:51 AM

Hi,

 

I can get the thumbnail view of the active document from below code

 

Document doc = Application.DocumentManager.MdiActiveDocument;
System.Drawing.Bitmap bit = doc.Database.ThumbnailBitmap;

 

 

How can i get the thumbnail view of the dwg file by passing filename means like below.

 

Document doc = .....(fileName)  :  here fileName is dwg file.

 

Please advise on this issue.

 

Regards,

Raman

 

 

 

 

Hi,

 

Why do you have to use the AutoCAD API if you can get the same result without it?

if you want to calculate sin(alpha) ... what could be the reason for doing that with a specific API from AutoCAD instead of the global Math-namespace?

 

Sorry if I bother you, I'd like to understand why doing something more complex that can be achieved in an easy way (ready to use and independet from any AutoCAD release).

 

- alfred -

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 8 (1,388 Views)

Re: Dwg thumbnail view using .Net

03-01-2012 06:13 AM in reply to: RamanSBV

Google is your friend:

http://www.google.ru/search?ie=UTF-8&hl=ru&q=DisplayPreviewFromDwg

 

Here is one from my program:

 

http://forums.augi.com/showpost.php?p=1085953&postcount=2

 

Code Conveter

 

http://converter.telerik.com/

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Moderator
Alexander.Rivilis
Posts: 1,450
Registered: ‎04-09-2008
Message 3 of 8 (1,355 Views)

Re: Dwg thumbnail view using .Net

03-01-2012 12:43 PM in reply to: RamanSBV

http://www.theswamp.org/index.php?topic=30985.msg442803#msg442803


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 4 of 8 (1,313 Views)

Re: Dwg thumbnail view using .Net

03-04-2012 10:25 PM in reply to: Hallex

 

 

This code is good.

 

But i am using 2010. will it works?

 

Please advise me

 

Regards,

Raman

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 5 of 8 (1,306 Views)

Re: Dwg thumbnail view using .Net

03-04-2012 11:01 PM in reply to: RamanSBV

Hi,

 

it's just copy&paste, compile and test .... so why not trying it?

 

And if you look to the code you'll see it does not use any AutoCAD-lib-functions. so it's independent from any AutoCAD-version (it just reads the icon-part of the image header)

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 6 of 8 (1,303 Views)

Re: Dwg thumbnail view using .Net

03-04-2012 11:47 PM in reply to: Alfred.NESWADBA

 

 

I am not looking for what you have suggested means using with out autocad.

 

I would like to use AutoCAD API for getting thumbnail. (Message 2).

 

Please advise.

 

Thanks is advance.....

*Expert Elite*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 7 of 8 (1,282 Views)

Re: Dwg thumbnail view using .Net

03-05-2012 09:34 AM in reply to: RamanSBV

Hi,

 

Why do you have to use the AutoCAD API if you can get the same result without it?

if you want to calculate sin(alpha) ... what could be the reason for doing that with a specific API from AutoCAD instead of the global Math-namespace?

 

Sorry if I bother you, I'd like to understand why doing something more complex that can be achieved in an easy way (ready to use and independet from any AutoCAD release).

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 8 of 8 (1,265 Views)

Re: Dwg thumbnail view using .Net

03-05-2012 08:24 PM in reply to: RamanSBV

 

Thanks you very much... I do as you suggested...

 

-Raman

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.