obtain thumbnail image?

obtain thumbnail image?

skyngu
Collaborator Collaborator
2,125 Views
7 Replies
Message 1 of 8

obtain thumbnail image?

skyngu
Collaborator
Collaborator
hi all,

there is a thumbnail image for each part in inventor. I creat a part list for an assembly. I want to get a bath of thumbnail images of each part from the partlist, and save as each jpg or bmp files ONLY. So i dont have to take a picture of each part by using camera. It is kinda time consuming of opening each part and save as jpg. When i did a search on forum, i saw someone can create a partlist with thumbnail view. But i want jpg or bmp format of each part only.

Thanks for any suggestions or help.
Autodesk Inventor Professional 2019
0 Likes
2,126 Views
7 Replies
Replies (7)
Message 2 of 8

JarFu
Autodesk
Autodesk
Hi, VB function SavePicture can be used to save the Document.Thumbnail as bmp, jpg, wmf, emf, icon or gif file.

Sub PartslistView()
Dim oDraw As DrawingDocument
Set oDraw = ThisApplication.ActiveDocument

Dim oPartslist As PartsList
Set oPartslist = oDraw.ActiveSheet.PartsLists(1)

Dim oRow As PartsListRow, oDoc As Document
For Each oRow In oPartslist.PartsListRows
Set oDoc = oRow.ReferencedFiles(1).ReferencedDocument
SavePicture oDoc.Thumbnail, "C:\Temp\" & oDoc.DisplayName & ".bmp"
Next
End Sub Edited by: GuanZi432100 on Apr 12, 2010 6:31 AM


Jar Fu
SW Engineer
Inventor QA
Autodesk, Inc.
0 Likes
Message 3 of 8

skyngu
Collaborator
Collaborator
GuanZi,

thanks a lot!!! It works very well.
Autodesk Inventor Professional 2019
0 Likes
Message 4 of 8

skyngu
Collaborator
Collaborator
hi, can anyone tell me how to change size of output image in this macro? thanks
Autodesk Inventor Professional 2019
0 Likes
Message 5 of 8

Anonymous
Not applicable
These are a fixed size. You can use other functionality within VB to scale
them to any size but if you scale them bigger they will look pixelated.
When you save a file, Inventor captures and save an image to use as the
thumbnail. When you get the thumbnail you're getting that saved image, so
you can't get any arbitrary size since Inventor is just providing what it
already has. If you need higher resolution images you'll need to open the
document and use the View.SaveAsImage method. This allows you to save the
current view as any size you want.
--
Brian Ekins
Inventor API Product Designer
http://blogs.autodesk.com/modthemachine
0 Likes
Message 6 of 8

Anonymous
Not applicable
Brian,

I know what you are saying but I'd like to know how to scale the image as well. Do you mind mentioning the VB functionality to do this?

Thanks in advance.
0 Likes
Message 7 of 8

skyngu
Collaborator
Collaborator
I would like it to be 200 pixels X 200 pixels. The original saved thumbnail image is 2300 pixels X 2300 pixels.
Autodesk Inventor Professional 2019
0 Likes
Message 8 of 8

elmersmfg
Participant
Participant

Is there a way to convert all the thumbnails to a wireframe image or atleast change the background color to be white so we don't have to waste all that ink when printing out parts lists etc?

0 Likes