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?
|
|
|
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?
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.... ▒
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.
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.... ▒
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