See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: VBA drawing thumbnail

  1. #1
    Member
    Join Date
    2018-10
    Posts
    8
    Login to Give a bone
    0

    Default VBA drawing thumbnail

    I have VBA macro in excel that extracts and modifies the attributes of a block in the drawing, however the thumbnail is gone when it save as the drawing. Is there a way to keep the previous thumbnail when I save as?

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,396
    Login to Give a bone
    1

    Default Re: VBA drawing thumbnail

    No, there is no api for working with the preview. It simply saves the current view upon saving the dwg. The best you can do is save the view when you open it, pan/zoom around as you wish, then restore the view before saving.
    C:> ED WORKING....

  3. #3
    Member
    Join Date
    2018-10
    Posts
    8
    Login to Give a bone
    0

    Default Re: VBA drawing thumbnail

    Oh ok thanks

  4. #4
    Member
    Join Date
    2018-10
    Posts
    8
    Login to Give a bone
    0

    Default Re: VBA drawing thumbnail

    Quote Originally Posted by Ed Jobe View Post
    No, there is no api for working with the preview. It simply saves the current view upon saving the dwg. The best you can do is save the view when you open it, pan/zoom around as you wish, then restore the view before saving.
    I don't have a strong programming background, if I am understanding this correctly i can't keep the thumbnail using DBX. I made another code not in DBX. I am opening the drawings make the modification I need and I then zoomextent, save and close. But the thumbnail still does not show in explorer. Please let me know if I am going about it incorrectly. I am just in need an automate way that would keep/generate a new thumbnail for the drawing

    Code:
           Dim AcadApp As AcadApplication
           
             'Open Drawing
             'Do some other stuff
            AcadApp.ActiveDocument.ActiveSpace = acPaperSpace 
            AcadApp.Application.ZoomExtents
            AcadApp.ActiveDocument.Save
            AcadApp.ActiveDocument.Close
    Last edited by Rafurious; 2018-10-24 at 03:13 PM.

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,396
    Login to Give a bone
    0

    Default Re: VBA drawing thumbnail

    You didn't mention ObjectDBX before. It doesn't save the preview because the drawing editor is not open for it to get an image. You have to use an full open instance of acad to save the preview.
    C:> ED WORKING....

  6. #6
    Member
    Join Date
    2018-10
    Posts
    8
    Login to Give a bone
    0

    Default Re: VBA drawing thumbnail

    I figured out what my issue is:

    Code:
     Sub test()
    
        ThisDrawing.ActiveSpace = acPaperSpace
        ThisDrawing.Application.ZoomExtents
        
        ThisDrawing.Application.ActiveDocument.Save  'this won't save a thumbnail preview
        
        ThisDrawing.SendCommand ("qsave" & vbCr)  'this would save thumbnail preview
        
       End Sub

Similar Threads

  1. Drawing thumbnail is not shown in folder
    By ismail.asi.160407 in forum AutoCAD General
    Replies: 5
    Last Post: 2010-05-18, 08:12 AM
  2. Drawing File Thumbnail Preview
    By Coolmo in forum Dot Net API
    Replies: 3
    Last Post: 2010-03-19, 09:55 AM
  3. No drawing preview in thumbnail mode in Windows XP
    By RyanSS in forum AutoCAD General
    Replies: 2
    Last Post: 2008-07-30, 01:50 PM
  4. THUMBNAIL
    By caroharo in forum AutoCAD General
    Replies: 1
    Last Post: 2008-04-02, 12:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •