.NET

Reply
*GPaolo
Message 1 of 11 (744 Views)

Acad2010 thumbnail

744 Views, 10 Replies
04-23-2010 06:57 AM
I have a programm in Autocad 2009 that change something in a series of Dwg
and when i make closeandsave(filename) store also the thumbnail.
I see the preview in explorer.
Now i have install Acad2010 and recompile the program with the new
library,but the closeandsave(filename) don't store the thumbnail.
Some help?
thanks in advance.
GPQ
*Tony Tanzillo
Message 2 of 11 (744 Views)

Re: Acad2010 thumbnail

04-23-2010 02:45 PM in reply to: *GPaolo
In AutoCAD 2010 or later, you can call the
Document's CreatePreviewImage() method,
and assign the result to the Database's
ThumbnailBitmap property.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"GPaolo" wrote in message
news:6379160@discussion.autodesk.com...
I have a programm in Autocad 2009 that change something in a series of Dwg
and when i make closeandsave(filename) store also the thumbnail.
I see the preview in explorer.
Now i have install Acad2010 and recompile the program with the new
library,but the closeandsave(filename) don't store the thumbnail.
Some help?
thanks in advance.
GPQ
gpq
Member
gpq
Posts: 5
Registered: ‎10-07-2008
Message 3 of 11 (744 Views)

Re: Acad2010 thumbnail

04-24-2010 12:04 AM in reply to: *GPaolo
Yes,i have see it and i have already try it,but when i save in Acad i obtain a thumbnail with white background color (in explore) when i create thumbnail by program with the function "CreatePreviewImage" i obtain a thumbnail indefinite and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
*Tony Tanzillo
Message 4 of 11 (744 Views)

Re: Acad2010 thumbnail

04-24-2010 07:37 AM in reply to: *GPaolo
The thumbnail stored in the database should be the
same as the one returned by CapturePreviewImage().

It's possible that the background color is manipulated
when Explorer requests the thumbnail.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6379790@discussion.autodesk.com...
Yes,i have see it and i have already try it,but when i save in Acad i obtain a
thumbnail with white background color (in explore) when i create thumbnail by
program with the function "CreatePreviewImage" i obtain a thumbnail indefinite
and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
*Tony Tanzillo
Message 5 of 11 (744 Views)

Re: Acad2010 thumbnail

04-24-2010 02:52 PM in reply to: *GPaolo
If you're using AutoCAD 2011, then don't bother with this method.

Autodesk apparently has broken this method an if you call it
AutoCAD will stop responding.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6379790@discussion.autodesk.com...
Yes,i have see it and i have already try it,but when i save in Acad i obtain a
thumbnail with white background color (in explore) when i create thumbnail by
program with the function "CreatePreviewImage" i obtain a thumbnail indefinite
and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
*GPaolo
Message 6 of 11 (744 Views)

Re: Acad2010 thumbnail

04-25-2010 10:55 PM in reply to: *GPaolo
No,i use Acad2010.
My Background color in Acad2010 is black like in Acad2009 and if i save the
drawing by Acad the thumbnail that i see is correct.
If i save the same drawing by .net program i don't obtain the same thing.
Thank's.
GPQ


"Tony Tanzillo" ha scritto nel messaggio
news:6379897@discussion.autodesk.com...
If you're using AutoCAD 2011, then don't bother with this method.

Autodesk apparently has broken this method an if you call it
AutoCAD will stop responding.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6379790@discussion.autodesk.com...
Yes,i have see it and i have already try it,but when i save in Acad i
obtain a
thumbnail with white background color (in explore) when i create thumbnail
by
program with the function "CreatePreviewImage" i obtain a thumbnail
indefinite
and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
*GPaolo
Message 7 of 11 (744 Views)

Re: Acad2010 thumbnail

04-26-2010 02:31 AM in reply to: *GPaolo
version Acad2009:

doc.LockDocument.Dispose()

doc.CloseAndSave(NomeDwg)

doc.Dispose()

I have replace it in Acad2010 version with :
'Dim bm As Bitmap = doc.CapturePreviewImage(128, 102) Not used

'doc.Database.ThumbnailBitmap() = bm
Not used

doc.Database.SaveAs(NomeDwg, True, AcDbs.DwgVersion.Current,
doc.Database.SecurityParameters)

doc.LockDocument.Dispose()

doc.CloseAndDiscard()

doc.Dispose()

***********************************************************
Now all work fine like in Acad2009 version.

Thank's Tony

"Tony Tanzillo" ha scritto nel messaggio
news:6379897@discussion.autodesk.com...
If you're using AutoCAD 2011, then don't bother with this method.

Autodesk apparently has broken this method an if you call it
AutoCAD will stop responding.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6379790@discussion.autodesk.com...
Yes,i have see it and i have already try it,but when i save in Acad i
obtain a
thumbnail with white background color (in explore) when i create thumbnail
by
program with the function "CreatePreviewImage" i obtain a thumbnail
indefinite
and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
*Tony Tanzillo
Message 8 of 11 (744 Views)

Re: Acad2010 thumbnail

04-26-2010 05:23 AM in reply to: *GPaolo
Great, but don't expect it to work in 2011.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"GPaolo" wrote in message
news:6380212@discussion.autodesk.com...
version Acad2009:

doc.LockDocument.Dispose()

doc.CloseAndSave(NomeDwg)

doc.Dispose()

I have replace it in Acad2010 version with :
'Dim bm As Bitmap = doc.CapturePreviewImage(128, 102) Not used

'doc.Database.ThumbnailBitmap() = bm
Not used

doc.Database.SaveAs(NomeDwg, True, AcDbs.DwgVersion.Current,
doc.Database.SecurityParameters)

doc.LockDocument.Dispose()

doc.CloseAndDiscard()

doc.Dispose()

***********************************************************
Now all work fine like in Acad2009 version.

Thank's Tony

"Tony Tanzillo" ha scritto nel messaggio
news:6379897@discussion.autodesk.com...
If you're using AutoCAD 2011, then don't bother with this method.

Autodesk apparently has broken this method an if you call it
AutoCAD will stop responding.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message
news:6379790@discussion.autodesk.com...
Yes,i have see it and i have already try it,but when i save in Acad i
obtain a
thumbnail with white background color (in explore) when i create thumbnail
by
program with the function "CreatePreviewImage" i obtain a thumbnail
indefinite
and with black background color like my background color in Acad.
Any other suggestion?
Thanks and good week-end.
GPQ
Contributor
josano
Posts: 15
Registered: ‎04-22-2010
Message 9 of 11 (744 Views)

Re: Acad2010 thumbnail

04-26-2010 06:26 AM in reply to: *GPaolo
Hello,

I tried using the above code with c # but I could not use CreatePreviewImage () method.
Can anyone help me how do I get the thumbnail and display it in a picturebox in autocad 2008?

Thanks,
Josano Edited by: josano on Apr 26, 2010 1:27 PM
*GPaolo
Message 10 of 11 (742 Views)

Re: Acad2010 thumbnail

04-27-2010 10:58 PM in reply to: *GPaolo
There is ocx that make this job ,but i have found from other developer a
class that i have modify to change also the background color of thumbnail.
Try to use it.
Ciao


ha scritto nel messaggio news:6380348@discussion.autodesk.com...
Hello,

I tried using the above code with c # but I could not use
CreatePreviewImage () method.
Can anyone help me how do I get the thumbnail and display it in a
picturebox in autocad 2008?

Thanks,
Josano

Edited by: josano on Apr 26, 2010 1:27 PM
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.