<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Save preview to file in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/3357775#M84691</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Auto CAD 2010 and .net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please tell me how i can get the preview of the dwg file using file name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2012 06:37:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-03-05T06:37:20Z</dc:date>
    <item>
      <title>Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351977#M84673</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I try to save the thumbnail to a file, but it seems ThumbnailBitmap is alway's nothing. Does anyone know how to use this Autodesk.AutoCAD.DatabaseServices.Database.ThumbnailBitmap?&lt;BR /&gt;
&lt;BR /&gt;
thanks,&lt;BR /&gt;
&lt;BR /&gt;
Evert&lt;BR /&gt;
&lt;BR /&gt;
----&lt;BR /&gt;
Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;
Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;
Imports System.Collections&lt;BR /&gt;
Imports System.Text&lt;BR /&gt;
Imports System.Drawing&lt;BR /&gt;
&lt;BR /&gt;
Public Class PreviewBitMap&lt;BR /&gt;
    Public Sub test()&lt;BR /&gt;
        Dim bm As Bitmap&lt;BR /&gt;
        Dim db As Database&lt;BR /&gt;
        Try&lt;BR /&gt;
            'Get the current database&lt;BR /&gt;
            db = HostApplicationServices.WorkingDatabase&lt;BR /&gt;
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("db loaded")&lt;BR /&gt;
            If db.ThumbnailBitmap Is Nothing Then&lt;BR /&gt;
                Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("geen bitmap?")&lt;BR /&gt;
            Else&lt;BR /&gt;
                db.ThumbnailBitmap.Save("test.bmp")&lt;BR /&gt;
            End If&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("test:" + ex.Message)&lt;BR /&gt;
        Finally&lt;BR /&gt;
            If Not bm Is Nothing Then bm.Dispose()&lt;BR /&gt;
        End Try&lt;BR /&gt;
    End Sub&lt;BR /&gt;
End Class</description>
      <pubDate>Sun, 12 Jun 2005 19:34:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351977#M84673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-12T19:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351978#M84674</link>
      <description>You can't set a thumbnail currently. I consider this a bug so I'll make sure &lt;BR /&gt;
we have defect logged.&lt;BR /&gt;
&lt;BR /&gt;
albert&lt;BR /&gt;
&lt;EVERTM&gt; wrote in message news:4872660@discussion.autodesk.com...&lt;BR /&gt;
Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I try to save the thumbnail to a file, but it seems ThumbnailBitmap is &lt;BR /&gt;
alway's nothing. Does anyone know how to use this &lt;BR /&gt;
Autodesk.AutoCAD.DatabaseServices.Database.ThumbnailBitmap?&lt;BR /&gt;
&lt;BR /&gt;
thanks,&lt;BR /&gt;
&lt;BR /&gt;
Evert&lt;BR /&gt;
&lt;BR /&gt;
----&lt;BR /&gt;
Imports Autodesk.AutoCAD.Runtime&lt;BR /&gt;
Imports Autodesk.AutoCAD.ApplicationServices&lt;BR /&gt;
Imports Autodesk.AutoCAD.DatabaseServices&lt;BR /&gt;
Imports System.Collections&lt;BR /&gt;
Imports System.Text&lt;BR /&gt;
Imports System.Drawing&lt;BR /&gt;
&lt;BR /&gt;
Public Class PreviewBitMap&lt;BR /&gt;
    Public Sub test()&lt;BR /&gt;
        Dim bm As Bitmap&lt;BR /&gt;
        Dim db As Database&lt;BR /&gt;
        Try&lt;BR /&gt;
            'Get the current database&lt;BR /&gt;
            db = HostApplicationServices.WorkingDatabase&lt;BR /&gt;
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("db &lt;BR /&gt;
loaded")&lt;BR /&gt;
            If db.ThumbnailBitmap Is Nothing Then&lt;BR /&gt;
                Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("geen &lt;BR /&gt;
bitmap?")&lt;BR /&gt;
            Else&lt;BR /&gt;
                db.ThumbnailBitmap.Save("test.bmp")&lt;BR /&gt;
            End If&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("test:" &lt;BR /&gt;
+ ex.Message)&lt;BR /&gt;
        Finally&lt;BR /&gt;
            If Not bm Is Nothing Then bm.Dispose()&lt;BR /&gt;
        End Try&lt;BR /&gt;
    End Sub&lt;BR /&gt;
End Class&lt;/EVERTM&gt;</description>
      <pubDate>Mon, 13 Jun 2005 03:49:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351978#M84674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-13T03:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351979#M84675</link>
      <description>I reported this, but the thumbnail attribute has the status 'Not Implemented' (yet). It would be nice if  autocad would throw an 'Not Implemented' error instead of just returning Nothing.</description>
      <pubDate>Wed, 22 Jun 2005 15:07:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351979#M84675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-22T15:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351980#M84676</link>
      <description>"Albert Szilvasy" &lt;NOT_PROVIDED&gt; wrote &lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; You can't set a thumbnail currently. I consider this &lt;BR /&gt;
&amp;gt;&amp;gt; a bug so I'll make sure we have defect logged.&lt;BR /&gt;
&lt;BR /&gt;
If the objective is getting the bitmap, as opposed to&lt;BR /&gt;
setting it, the problem is most likely this (from the &lt;BR /&gt;
docs for AcDbDatabase::thumbnailBitmap):&lt;BR /&gt;
&lt;BR /&gt;
&lt;QUOTE&gt;&lt;BR /&gt;
&lt;BR /&gt;
"Note These APIs are meant primarily for ObjectDBX developers. &lt;BR /&gt;
Preview thumbnail behavior reflect what the host application must &lt;BR /&gt;
do to generate a preview.&lt;BR /&gt;
&lt;BR /&gt;
For ObjectARX developers AutoCAD is taking care of all preview &lt;BR /&gt;
thumbnail generation. ObjectARX users should leave these APIs&lt;BR /&gt;
alone, and allow AutoCAD behaviors to prevail.&lt;BR /&gt;
&lt;BR /&gt;
Most of the time, the AcDbDatabase::thumbnailBitmap() method &lt;BR /&gt;
will return nothing, since the bitmap is not read into memory by&lt;BR /&gt;
AcDbDatabase::readDwgFile(). To retreive the thumbnail from the &lt;BR /&gt;
DWG file, (as opposed to directly from the db) the same existing&lt;BR /&gt;
ObjectARX standalone functions are preferred. (for example &lt;BR /&gt;
acdbDisplayPreviewFromDwg())".&lt;BR /&gt;
&lt;BR /&gt;
&lt;/QUOTE&gt;&lt;BR /&gt;
&lt;BR /&gt;
I haven't tried this, but it should work (please let me know&lt;BR /&gt;
if it doesn't).&lt;BR /&gt;
&lt;BR /&gt;
/////////////////// ThumbnailExtractor.cs ///////////////////////&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Drawing;&lt;BR /&gt;
using System.Runtime.InteropServices;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
 &lt;BR /&gt;
namespace acdbUtils&lt;BR /&gt;
{&lt;BR /&gt;
   public class ThumbnailExtractor&lt;BR /&gt;
   {&lt;BR /&gt;
      [System.Security.SuppressUnmanagedCodeSecurity] &lt;BR /&gt;
      [DllImport("acdb16.dll", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
          EntryPoint = "?acdbGetPreviewBitmap@@YAPAUtagBITMAPINFO@@PBD@Z")]&lt;BR /&gt;
      extern static private IntPtr acdbGetPreviewBitmap(string filename);&lt;BR /&gt;
         &lt;BR /&gt;
      static Bitmap GetBitmapFromDwg(string filename)&lt;BR /&gt;
      {&lt;BR /&gt;
         return Marshaler.BitmapInfoToBitmap(acdbGetPreviewBitmap(filename));&lt;BR /&gt;
      }&lt;BR /&gt;
   }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
//////////////////////////////////////////////////////////////////////////////&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;/NOT_PROVIDED&gt;</description>
      <pubDate>Wed, 22 Jun 2005 16:44:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351980#M84676</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-22T16:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351981#M84677</link>
      <description>Sir ,&lt;BR /&gt;
As you told i tried this code but it didn't work&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-----------&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Drawing;&lt;BR /&gt;
using System.Runtime.InteropServices;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
&lt;BR /&gt;
namespace acdbUtils&lt;BR /&gt;
{&lt;BR /&gt;
public class ThumbnailExtractor&lt;BR /&gt;
{&lt;BR /&gt;
[System.Security.SuppressUnmanagedCodeSecurity] &lt;BR /&gt;
[DllImport("acdb16.dll", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
EntryPoint = "?acdbGetPreviewBitmap@@YAPAUtagBITMAPINFO@@PBD@Z")]&lt;BR /&gt;
extern static private IntPtr acdbGetPreviewBitmap(string filename);&lt;BR /&gt;
&lt;BR /&gt;
static Bitmap GetBitmapFromDwg(string filename)&lt;BR /&gt;
{&lt;BR /&gt;
return Marshaler.BitmapInfoToBitmap(acdbGetPreviewBitmap(filename));&lt;BR /&gt;
}&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-----------------------&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks....</description>
      <pubDate>Thu, 27 Jul 2006 06:11:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351981#M84677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-07-27T06:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351982#M84678</link>
      <description>[code]&lt;BR /&gt;
    [System.Security.SuppressUnmanagedCodeSecurity] &lt;BR /&gt;
    [DllImport("dwgpreview.arx", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi ,&lt;BR /&gt;
       EntryPoint = "SaveDWGPreview")]&lt;BR /&gt;
    extern static private int SaveDWGPreview(string dwgfilename, string bmpfilename);&lt;BR /&gt;
&lt;BR /&gt;
    [CommandMethod("SavePreview")]&lt;BR /&gt;
    public void SavePreview()&lt;BR /&gt;
    {&lt;BR /&gt;
      Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
      Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule("DWGPreview.arx",false,false);&lt;BR /&gt;
      SaveDWGPreview(db.Filename,"C:\\dwgpreview.bmp");&lt;BR /&gt;
    }&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
dwgpreview.arx for AutoCAD 2004...2006 is attached

Message was edited by: Alexander Rivilis</description>
      <pubDate>Thu, 31 Aug 2006 14:17:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351982#M84678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-31T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351983#M84679</link>
      <description>For AutoCAD 2007, this should do it:&lt;BR /&gt;
&lt;BR /&gt;
/// Form1.cs&lt;BR /&gt;
&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Collections.Generic;&lt;BR /&gt;
using System.ComponentModel;&lt;BR /&gt;
using System.Data;&lt;BR /&gt;
using System.Drawing;&lt;BR /&gt;
using System.Text;&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
using System.Runtime.InteropServices;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
// This form requires a PictureBox named 'pictureBox1': &lt;BR /&gt;
&lt;BR /&gt;
namespace ThumbnailSample&lt;BR /&gt;
{&lt;BR /&gt;
   public partial class Form1 : Form&lt;BR /&gt;
   {&lt;BR /&gt;
&lt;BR /&gt;
      public Form1()&lt;BR /&gt;
      {&lt;BR /&gt;
         InitializeComponent();&lt;BR /&gt;
      }&lt;BR /&gt;
&lt;BR /&gt;
      // R17 ONLY&lt;BR /&gt;
&lt;BR /&gt;
      [DllImport( "acad.exe", CallingConvention = CallingConvention.Cdecl,&lt;BR /&gt;
         EntryPoint = "?acedGenerateThumbnailBitmap@@YAPAUtagABITMAPINFO@@XZ" )]&lt;BR /&gt;
      private static extern IntPtr acedGenerateThumbnailBitmap();&lt;BR /&gt;
&lt;BR /&gt;
      private void ThumbView_Load( object sender, EventArgs e )&lt;BR /&gt;
      {&lt;BR /&gt;
         IntPtr bmi = acedGenerateThumbnailBitmap();&lt;BR /&gt;
         if( bmi != IntPtr.Zero )&lt;BR /&gt;
         {&lt;BR /&gt;
            Bitmap bm = Marshaler.BitmapInfoToBitmap( bmi );&lt;BR /&gt;
            pictureBox1.Image = (System.Drawing.Image) bm.Clone();&lt;BR /&gt;
            bm.Dispose();&lt;BR /&gt;
         }&lt;BR /&gt;
      }&lt;BR /&gt;
&lt;BR /&gt;
      [CommandMethod( "THUMBVIEW" )]&lt;BR /&gt;
      public static void doit()&lt;BR /&gt;
      {&lt;BR /&gt;
         using( Form1 form = new Form1() )&lt;BR /&gt;
            AcadApp.ShowModalDialog( form );&lt;BR /&gt;
      }&lt;BR /&gt;
   }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXANDER rivilis=""&gt; wrote in message news:5313888@discussion.autodesk.com...&lt;BR /&gt;
[code]&lt;BR /&gt;
    [System.Security.SuppressUnmanagedCodeSecurity] &lt;BR /&gt;
    [DllImport("dwgpreview.arx", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi ,&lt;BR /&gt;
       EntryPoint = "SaveDWGPreview")]&lt;BR /&gt;
    extern static private int SaveDWGPreview(string dwgfilename, string bmpfilename);&lt;BR /&gt;
&lt;BR /&gt;
    [CommandMethod("SavePreview")]&lt;BR /&gt;
    public void SavePreview()&lt;BR /&gt;
    {&lt;BR /&gt;
      Database db = HostApplicationServices.WorkingDatabase;&lt;BR /&gt;
      Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.Load&lt;BR /&gt;
Module("DWGPreview.arx",false,false);&lt;BR /&gt;
      SaveDWGPreview(db.Filename,"C:\\dwgpreview.bmp");&lt;BR /&gt;
    }&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
dwgpreview.arx for AutoCAD 2004...2006 is attached&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Alexander Rivilis&lt;/ALEXANDER&gt;</description>
      <pubDate>Thu, 31 Aug 2006 16:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351983#M84679</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-31T16:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351984#M84680</link>
      <description>Sir,&lt;BR /&gt;
Your code is working great. But i want to know does it not works for Autocad 2007 3D Drawings template(acad3D.dwt type files). If i want to save all types of autocad files's thumbanil then how can i achive this.&lt;BR /&gt;
Thanks...</description>
      <pubDate>Sun, 03 Sep 2006 07:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351984#M84680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-03T07:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351985#M84681</link>
      <description>Hi rivilis,&lt;BR /&gt;
I want to know if you have got dwgpreview.arx for Autocad 2007. IF not then how can i do it in 2007. Tony's code is working but not for 3D drawings.&lt;BR /&gt;
Thanks....</description>
      <pubDate>Mon, 04 Sep 2006 03:29:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351985#M84681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-04T03:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351986#M84682</link>
      <description>Try it:&lt;BR /&gt;
[code]&lt;BR /&gt;
    [System.Security.SuppressUnmanagedCodeSecurity]&lt;BR /&gt;
    [DllImport("dwgpreview.arx", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode,&lt;BR /&gt;
       EntryPoint = "SaveDWGPreview")]&lt;BR /&gt;
    extern static private int SaveDWGPreview(string dwgfilename, string bmpfilename);&lt;BR /&gt;
[/code]</description>
      <pubDate>Mon, 04 Sep 2006 09:35:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351986#M84682</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-04T09:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351987#M84683</link>
      <description>Alex's code extracts an existing preview from a .DWG file&lt;BR /&gt;
that's been saved (with a preview), and writes it out to a&lt;BR /&gt;
BMP file.&lt;BR /&gt;
&lt;BR /&gt;
The code I posted doesn't do that. Instead, it generates &lt;BR /&gt;
a new preview image of the Active viewport of the active &lt;BR /&gt;
document, but it is not assigned as the database's saved&lt;BR /&gt;
thumbnail.&lt;BR /&gt;
&lt;BR /&gt;
It may also help to know that to do what Alex's code&lt;BR /&gt;
does, you don't need native ObjectARX. You can use the&lt;BR /&gt;
Shell's IExtractImage COM interface to get the thumbnail&lt;BR /&gt;
preview for any file type that has one, including DWG files. &lt;BR /&gt;
&lt;BR /&gt;
Have at look here for working example code:&lt;BR /&gt;
&lt;BR /&gt;
http://www.vbaccelerator.com/home/net/code/libraries/Shell_Projects/Thumbnail_Extraction/article.asp&lt;BR /&gt;
&lt;BR /&gt;
So, it depends on what you want to do (generate a new&lt;BR /&gt;
preview, or 'snapshot' of the active viewport, or just get&lt;BR /&gt;
the preview thumbnail from a saved file). If the drawing&lt;BR /&gt;
is open in the editor, you should be able to save it, then&lt;BR /&gt;
use Alex's code, or IExtractImage to get an up-to-date &lt;BR /&gt;
thumbnail.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;ASLAM&gt; wrote in message news:5316869@discussion.autodesk.com...&lt;BR /&gt;
Hi rivilis,&lt;BR /&gt;
I want to know if you have got dwgpreview.arx for Autocad 2007. IF not then how can i do it in 2007. Tony's code is working but not for 3D drawings.&lt;BR /&gt;
Thanks....&lt;/ASLAM&gt;</description>
      <pubDate>Tue, 05 Sep 2006 08:32:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351987#M84683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-05T08:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351988#M84684</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
interesting idea to do it with a own arx. &lt;BR /&gt;
&lt;BR /&gt;
  [System.Security.SuppressUnmanagedCodeSecurity] &lt;BR /&gt;
    [DllImport("dwgpreview.arx", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi ,&lt;BR /&gt;
       EntryPoint = "SaveDWGPreview")]&lt;BR /&gt;
    extern static private int SaveDWGPreview(string dwgfilename, string bmpfilename);&lt;BR /&gt;
&lt;BR /&gt;
My question: How is the definition of the function (dllexport) in the ARX programm.&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
Peter</description>
      <pubDate>Fri, 24 Nov 2006 07:25:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351988#M84684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-24T07:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351989#M84685</link>
      <description>For AutoCAD 2006:&lt;BR /&gt;
__declspec( dllexport ) int SaveDWGPreview(const char *dwgfile, const char *bmpfile);&lt;BR /&gt;
For AutoCAD 2007:&lt;BR /&gt;
__declspec( dllexport ) int SaveDWGPreview(const TCHAR *dwgfile, const TCHAR *bmpfile);&lt;BR /&gt;
Also dwgpreview.def has lines:&lt;BR /&gt;
[code]&lt;BR /&gt;
EXPORTS&lt;BR /&gt;
  SaveDWGPreview&lt;BR /&gt;
[/code]</description>
      <pubDate>Fri, 24 Nov 2006 11:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351989#M84685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-24T11:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351990#M84686</link>
      <description>Any chance that this could be fixed to work with R2006?&lt;BR /&gt;
I've made some modest attempts to doso, but it appears that resources like using System.Collections.Generic; are not present in 2006.&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
      <pubDate>Mon, 18 Feb 2008 18:36:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351990#M84686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-02-18T18:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351991#M84687</link>
      <description>That is not an Acad error, it is a framwork issue.  System.Collections.Generic isn't available until .Net 2.0.</description>
      <pubDate>Mon, 18 Feb 2008 20:58:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351991#M84687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-02-18T20:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351992#M84688</link>
      <description>&amp;gt;&amp;gt;&amp;gt;it is a framwork issue&lt;BR /&gt;
&lt;BR /&gt;
Thanks TIm,&lt;BR /&gt;
After I though about it a bit, I thought that probably was the case.&lt;BR /&gt;
&lt;BR /&gt;
In any case, reading the preview image, and displaying it, is something that I think I could do. But I'd be more interested in getting the current viewport view as Tony suggested that his .cs does. &lt;BR /&gt;
That would not only replace what we do now in Vlisp, it would be better. &lt;BR /&gt;
In our current program, I read the block entities and draw the part, using a transformation matrix to get the VIEW ucs, then use grvecs to put it into an image_tile.&lt;BR /&gt;
Something that I imagine would be far more complicated in C#. &lt;BR /&gt;
Anyway, I think a view of the current viewport would do it.&lt;BR /&gt;
&lt;BR /&gt;
TIA&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
      <pubDate>Tue, 19 Feb 2008 02:04:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351992#M84688</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-02-19T02:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351993#M84689</link>
      <description>&amp;gt;&amp;gt;&amp;gt;Anyway, I think a view of the current viewport would do it.&lt;BR /&gt;
&lt;BR /&gt;
Hmm,&lt;BR /&gt;
Maybe not.&lt;BR /&gt;
&lt;BR /&gt;
I need to be able to display only the one part selected in the listbox. I've attached a .png of the DCL version.&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
      <pubDate>Tue, 19 Feb 2008 12:02:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351993#M84689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-02-19T12:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351994#M84690</link>
      <description>Well I did find a way to accomplish the image problem.&lt;BR /&gt;
Thanks to Kean Walmsley(watch word wrap):&lt;BR /&gt;
http://through-the-interface.typepad.com/through_the_interface/2007/02/using_the_com_i.html&lt;BR /&gt;
&lt;BR /&gt;
I learned how to acces AutoCAD geometry points of certain entities and then use those points to "paint" on a picturebox.&lt;BR /&gt;
&lt;BR /&gt;
Thanks also to Tony T. for his PolarPoint function that enabled me to add points for arcs &amp;amp; circles.&lt;BR /&gt;
&lt;BR /&gt;
I still have some scaling and rotation isues to iron out but this program duplicates what the old Vlisp one did by displaying the selected block.&lt;BR /&gt;
I won't post the code as not all like Italian cusine but as I have time will sort things out better.&lt;BR /&gt;
&lt;BR /&gt;
The only problem is that once in a while, some of the points that are created with PolarPoint, to duplicate arcs, don't always end up on the right plane of the arc (Using arc startangle). So that's another issue to work on (see last image in the attached).&lt;BR /&gt;
&lt;BR /&gt;
But thanks for having this site and having people that are knowlegable in .net. &lt;BR /&gt;
Well ack to my "day job".&lt;BR /&gt;
&lt;BR /&gt;
Bill</description>
      <pubDate>Wed, 19 Mar 2008 14:07:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/1351994#M84690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-03-19T14:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/3357775#M84691</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Auto CAD 2010 and .net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please tell me how i can get the preview of the dwg file using file name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2012 06:37:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/3357775#M84691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-05T06:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Save preview to file</title>
      <link>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/3357793#M84692</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you have so much samples and links in the above posts. What have you tried from them? Or should all be repeated now againg?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, - alfred -&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2012 07:02:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/save-preview-to-file/m-p/3357793#M84692</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2012-03-05T07:02:51Z</dc:date>
    </item>
  </channel>
</rss>

