Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export pictures from assemblies

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
ahkliban
1835 Views, 16 Replies

Export pictures from assemblies

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.

 

Tags (2)
Labels (2)
16 REPLIES 16
Message 2 of 17
SharkDesign
in reply to: ahkliban

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. 

 

  Expert Elite
  Inventor Certified Professional
Message 3 of 17
JDMather
in reply to: SharkDesign


@SharkDesign wrote:

When you save the file that is the thumbnail it creates...


@SharkDesign 

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.

JDMather_0-1631623844759.png

 

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.


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


Message 4 of 17
ahkliban
in reply to: ahkliban

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?

Message 5 of 17
SharkDesign
in reply to: ahkliban

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.

 

 

  Expert Elite
  Inventor Certified Professional
Message 6 of 17
SharkDesign
in reply to: ahkliban

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

 

  Expert Elite
  Inventor Certified Professional
Message 7 of 17
SharkDesign
in reply to: ahkliban

This will do every file open, not just the current assembly by the way. 

 

 

  Expert Elite
  Inventor Certified Professional
Message 8 of 17
ahkliban
in reply to: SharkDesign

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 🙂

Message 9 of 17
SharkDesign
in reply to: ahkliban

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

 

  Expert Elite
  Inventor Certified Professional
Message 10 of 17
ahkliban
in reply to: SharkDesign

It is always -1

The Revision numbers go from R00 to R99

 

I'am getting this error:

ahkliban_0-1632316803566.png

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? 🙂 

Message 11 of 17
SharkDesign
in reply to: ahkliban

Which line is 23?

  Expert Elite
  Inventor Certified Professional
Message 12 of 17
ahkliban
in reply to: SharkDesign

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?

Message 13 of 17
SharkDesign
in reply to: ahkliban

Yes, that's the right way, sorry about that, it's because I referenced the first one so I got confused. 

  Expert Elite
  Inventor Certified Professional
Message 14 of 17
SharkDesign
in reply to: ahkliban

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. 

 

 

  Expert Elite
  Inventor Certified Professional
Message 15 of 17
ahkliban
in reply to: SharkDesign

duplicate...

Message 16 of 17
ahkliban
in reply to: SharkDesign

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 🙂

Message 17 of 17

Please share the code here.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report