Hi guys and gals
I have assemblies that I would like to save pictures of the individual parts it is made of.
To do that I exported the BOM list with thumbnails.
Right clicked on each thumbnail and saved it with the corresponding part number.
After a while I discovered that the thumbnail was saved with the size it originally was exported with. Which means, a very tiny “thumbnail”.
So, I’m here asking you experts if you know about any method that makes it easy to export thumbnail pictures in high resolution. Preferably saving them with the corresponding item number.
I don’t know if this is possible, but can I make inventor export the thumbails in higher resolution to excel document? Then use a script or add-on of some kind to make excel save the pictures and naming them the text on the left side of the picture, which is the part number.
Solved! Go to Solution.
Solved by SharkDesign. Go to Solution.
No, they are the resolution they are.
When you save the file that is the thumbnail it creates and the BOM just repurposes that image.
It is not meant to be used in a larger format.
You could probably use iLogic to open the file, export as jpg, close it and open the next one in the assembly, but I can't tell you how to do that.
You can export every drawing this way, so there's probably a way to do this and export a jpg instead.
@SharkDesign wrote:
When you save the file that is the thumbnail it creates...
I have never used the thumbnails in BOM before. Do you have an example screenshot - I want to try this out.
This doesn't take care of any resolution problem - but any image can be used for the thumbnail in iProperties of each part.
Edit: Well after a bit of experimenting I am wondering if I read too much into this.
I thought maybe there was a way to include thumbnail column in Parts List, but I am not finding a way.
Is there any suggestions to how I can do it then? What would you do if you had to export a picture of each item to use it in a webshop?
For spares quotes, if there's a lot of items I just end up copy and pasting from the BOM.
If it was a web shop i'd probably have to do it manually, or if it was hundreds of items, I'd work out how to do it in iLogic.
Try this, set the save location you want and set your background colour in application options first:
Class this rule Dim iProp As String = "Part Number" 'Dim iProp As string = "Description" '(comment out what you don't want)
Dim iExt as string = ".jpg" 'can change this for .png, .bmp etc)
Dim iSave As String = "C:\output\" 'save location in here, make sure it ends with a slash \
Sub main Dim oDocs As Inventor.Documents oDocs = ThisApplication.Documents Dim oDoc As Inventor.Document For Each oDoc In oDocs Try ofile = oDoc.PropertySets.Item("Design Tracking Properties").Item(iProp).Value oDoc.SaveAs(iSave & ofile & iext, True) Catch Logger.Info("Weldment?", filename) End Try Next End Sub End Class
This will do every file open, not just the current assembly by the way.
Hi @SharkDesign
Thanks for the reply.
Is it possible to make the rule save the picture with Part Number followed by the value from Revision Number field in iProperties?
For instance the part name is 101011022. The revision is R02.
Is it possible to save the picture name as 101011022R02 followed by -1? Like 101011022R02-1
EDIT:
To make it place -1 after the Part and Revision number, I changed the picture save format from .jpeg to -1.jpeg and it worked 🙂
Is it always -1 or does that change?
Try this, again I can't test it.
Is your rev actually R02 or is it just 2?
Class this rule Dim iProp As String = "Part Number" 'Dim iProp As string = "Description" '(comment out what you don't want)
Dim iExt as string = ".jpg" 'can change this for .png, .bmp etc)
Dim iSave As String = "C:\output\" 'save location in here, make sure it ends with a slash \
Sub main Dim oDocs As Inventor.Documents oDocs = ThisApplication.Documents Dim oDoc As Inventor.Document For Each oDoc In oDocs Try ofile = oDoc.PropertySets.Item("Design Tracking Properties").Item(iProp).Value
oRev = oDoc.PropertySets.Item("Inventor Summary Information").Item(Revision Number).Value
oDoc.SaveAs(iSave & ofile & oRev & "-1" & iext, True) Catch Logger.Info("Weldment?", filename) End Try Next End Sub End Class
It is always -1
The Revision numbers go from R00 to R99
I'am getting this error:
The error translation:
Comma, ')' or a valid continuation of the expression was expected
EDIT: In line 23 I corrected
Item(Revision Number).Value
to
Item("Revision Number").Value
Tested it and its working. Was that the right way to do it? 🙂
Line 23 is
oRev = oDoc.PropertySets.Item("Inventor Summary Information").Item(Revision Number).Value
I edited it to
oRev = oDoc.PropertySets.Item("Inventor Summary Information").Item("Revision Number").Value
Is it possible to make it save the picture what transparent background?
Yes, that's the right way, sorry about that, it's because I referenced the first one so I got confused.
You'd have to use PNG for transparent. I don't think you can specify that from iLogic, but I don't know.
You could try doing one manually and see if it remembers to use alpha channel when you run the iLogic.
Unfortunately it didnt work. Nevertheless I now have a great tool to export the pictures 🙂
Thank you very much for the help.
If you stumble upon a code or a neat method to how we can save them with transparent background, please remember me and let me know 🙂
Can't find what you're looking for? Ask the community or share your knowledge.