<?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 Example: 2011 Thumbnail in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/example-2011-thumbnail/m-p/2707979#M64943</link>
    <description>&lt;P&gt;The firs onet gets the thumbnail of the layout you last saved in&amp;nbsp;the drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second gets all&amp;nbsp;layout thumbnails&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will create a folder C:\AcadImages when netloaded and delete it when autocad closes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thumbnail appeance depends on how&amp;nbsp;your screen was when&amp;nbsp;you last Saved&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another Idea is use ScreenCapture and around line 900 set&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;pofo.PreferCommandLine =&amp;nbsp; &lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="1"&gt;So you can send directly to the command prompt I started to mess with it post what I have but it is not very useful&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="1"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Windows
Imports System.Drawing
Imports System.IO
Imports System.Threading

Public Class Commands
    Implements IExtensionApplication

    &amp;lt;CommandMethod("DocumentThumbnail")&amp;gt; _
    Public Sub DocumentThumbnail()
        Dim doc As Document = DocumentManager.MdiActiveDocument
        doc.Database.ThumbnailBitmap.Save("C:\AcadImages\Doc.Png", System.Drawing.Imaging.ImageFormat.Png)
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    &amp;lt;CommandMethod("AllLayoutsThumbnail")&amp;gt; _
Public Sub AllLayoutsThumbnail()
        Dim DB As Database = HostApplicationServices.WorkingDatabase
        Using trans As Transaction = DB.TransactionManager.StartTransaction
            Dim bt As BlockTable = DB.BlockTableId.GetObject(OpenMode.ForRead)
            For Each btrObjID As ObjectId In bt
                Dim btr As BlockTableRecord = btrObjID.GetObject(OpenMode.ForRead)
                If btr.IsLayout = True Then
                    Dim lyt As Layout = btr.LayoutId.GetObject(OpenMode.ForRead)
                    Dim btm As System.Drawing.Bitmap = lyt.Thumbnail
                    btm.Save(String.Format("{0}\{1}.Gif", "C:\AcadImages", lyt.LayoutName, System.Drawing.Imaging.ImageFormat.Gif))
                End If
            Next
        End Using
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    ''' &amp;lt;summary&amp;gt;
    ''' This uses ScreenShot but you must REMOVESS if already loaded and add
    '''  pofo.PreferCommandLine = true and netload again around line 900 so msgbox does not pop up
    ''' It is buggy does not cause a exception but must hit return sometimes to make it work
    ''' Just started playing with it but I will post if anyway
    '''  &amp;lt;/summary&amp;gt;
    ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
    &amp;lt;CommandMethod("UseScreenShot")&amp;gt; _
    Public Sub UseScreenShot()
        Dim doc As Document = DocumentManager.MdiActiveDocument
        Try
            Dim DB As Database = HostApplicationServices.WorkingDatabase
            Using trans As Transaction = DB.TransactionManager.StartTransaction
                Dim bt As BlockTable = DB.BlockTableId.GetObject(OpenMode.ForRead)
                Dim btr As BlockTableRecord = doc.Database.CurrentSpaceId.GetObject(OpenMode.ForRead)
                If btr.IsLayout = True Then&lt;/FONT&gt;&lt;FONT size="1"&gt; &lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;                   Dim lyt As Layout = btr.LayoutId.GetObject(OpenMode.ForRead)
                    Dim lmts As Extents2d = lyt.Limits
                    Dim minPnt As String = lmts.MinPoint.ToString.Remove(lmts.MinPoint.ToString.Length - 1, 1)
                    Dim maxPnt As String = lmts.MaxPoint.ToString.Remove(lmts.MaxPoint.ToString.Length - 1, 1)
                    doc.SendStringToExecute( _
                    String.Format("{0}{1}{2}{3} ", "ScreenShot ", _
                                  minPnt.Remove(0, 1) &amp;amp; vbCrLf, _
                                  maxPnt.Remove(0, 1) &amp;amp; vbCrLf, "C:\AcadImages\Screenshot.Jpeg" &amp;amp; vbCrLf), _
                       True, False, False)
                End If
            End Using
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
        If Not Directory.Exists("C:\AcadImages") Then
            Try
                Directory.CreateDirectory("C:\AcadImages")
            Catch ex As UnauthorizedAccessException
                MsgBox("Do Not Have Rights To Create Folder" &amp;amp; vbCrLf &amp;amp; _
 "Change File Path And Reload")
            End Try
        End If
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
        Directory.Delete("C:\AcadImages", True)
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;End Class&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="1"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2010 23:05:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-07-02T23:05:38Z</dc:date>
    <item>
      <title>Example: 2011 Thumbnail</title>
      <link>https://forums.autodesk.com/t5/net-forum/example-2011-thumbnail/m-p/2707979#M64943</link>
      <description>&lt;P&gt;The firs onet gets the thumbnail of the layout you last saved in&amp;nbsp;the drawing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second gets all&amp;nbsp;layout thumbnails&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will create a folder C:\AcadImages when netloaded and delete it when autocad closes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thumbnail appeance depends on how&amp;nbsp;your screen was when&amp;nbsp;you last Saved&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another Idea is use ScreenCapture and around line 900 set&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;pofo.PreferCommandLine =&amp;nbsp; &lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;true&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="1"&gt;So you can send directly to the command prompt I started to mess with it post what I have but it is not very useful&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="1"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Windows
Imports System.Drawing
Imports System.IO
Imports System.Threading

Public Class Commands
    Implements IExtensionApplication

    &amp;lt;CommandMethod("DocumentThumbnail")&amp;gt; _
    Public Sub DocumentThumbnail()
        Dim doc As Document = DocumentManager.MdiActiveDocument
        doc.Database.ThumbnailBitmap.Save("C:\AcadImages\Doc.Png", System.Drawing.Imaging.ImageFormat.Png)
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    &amp;lt;CommandMethod("AllLayoutsThumbnail")&amp;gt; _
Public Sub AllLayoutsThumbnail()
        Dim DB As Database = HostApplicationServices.WorkingDatabase
        Using trans As Transaction = DB.TransactionManager.StartTransaction
            Dim bt As BlockTable = DB.BlockTableId.GetObject(OpenMode.ForRead)
            For Each btrObjID As ObjectId In bt
                Dim btr As BlockTableRecord = btrObjID.GetObject(OpenMode.ForRead)
                If btr.IsLayout = True Then
                    Dim lyt As Layout = btr.LayoutId.GetObject(OpenMode.ForRead)
                    Dim btm As System.Drawing.Bitmap = lyt.Thumbnail
                    btm.Save(String.Format("{0}\{1}.Gif", "C:\AcadImages", lyt.LayoutName, System.Drawing.Imaging.ImageFormat.Gif))
                End If
            Next
        End Using
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    ''' &amp;lt;summary&amp;gt;
    ''' This uses ScreenShot but you must REMOVESS if already loaded and add
    '''  pofo.PreferCommandLine = true and netload again around line 900 so msgbox does not pop up
    ''' It is buggy does not cause a exception but must hit return sometimes to make it work
    ''' Just started playing with it but I will post if anyway
    '''  &amp;lt;/summary&amp;gt;
    ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;
    &amp;lt;CommandMethod("UseScreenShot")&amp;gt; _
    Public Sub UseScreenShot()
        Dim doc As Document = DocumentManager.MdiActiveDocument
        Try
            Dim DB As Database = HostApplicationServices.WorkingDatabase
            Using trans As Transaction = DB.TransactionManager.StartTransaction
                Dim bt As BlockTable = DB.BlockTableId.GetObject(OpenMode.ForRead)
                Dim btr As BlockTableRecord = doc.Database.CurrentSpaceId.GetObject(OpenMode.ForRead)
                If btr.IsLayout = True Then&lt;/FONT&gt;&lt;FONT size="1"&gt; &lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;                   Dim lyt As Layout = btr.LayoutId.GetObject(OpenMode.ForRead)
                    Dim lmts As Extents2d = lyt.Limits
                    Dim minPnt As String = lmts.MinPoint.ToString.Remove(lmts.MinPoint.ToString.Length - 1, 1)
                    Dim maxPnt As String = lmts.MaxPoint.ToString.Remove(lmts.MaxPoint.ToString.Length - 1, 1)
                    doc.SendStringToExecute( _
                    String.Format("{0}{1}{2}{3} ", "ScreenShot ", _
                                  minPnt.Remove(0, 1) &amp;amp; vbCrLf, _
                                  maxPnt.Remove(0, 1) &amp;amp; vbCrLf, "C:\AcadImages\Screenshot.Jpeg" &amp;amp; vbCrLf), _
                       True, False, False)
                End If
            End Using
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    Public Sub Initialize() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
        If Not Directory.Exists("C:\AcadImages") Then
            Try
                Directory.CreateDirectory("C:\AcadImages")
            Catch ex As UnauthorizedAccessException
                MsgBox("Do Not Have Rights To Create Folder" &amp;amp; vbCrLf &amp;amp; _
 "Change File Path And Reload")
            End Try
        End If
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;    Public Sub Terminate() Implements Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
        Directory.Delete("C:\AcadImages", True)
    End Sub&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;End Class&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="1"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2010 23:05:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/example-2011-thumbnail/m-p/2707979#M64943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-07-02T23:05:38Z</dc:date>
    </item>
  </channel>
</rss>

