Thanks so far. But this is not wat i'm looking for.. As i have a model with a few 100 sheetmetal parts, this cost to much time. Found an Ilogic rule online somewhere but that one is not working. It makes a new image and stored it somewhere. Maybe there's a code that can change it a bit ? If it have to store a picture, would be fine that it is in the part folder.
Hope to see your response!
‘ ——————-start of rule——————-
‘===================SETTINGS=======================
‘set the image width in pixels, height will be calculated based on actual Inventor window width/height ratio
Dim imageWidth As Integer
imageWidth = 200
‘set save folder. Specified folder should already exist!
Dim savePath As String
savePath = “c:\temp\”
‘===================/SETTINGS=======================
‘ref to application
Dim oApp As application
oApp = ThisApplication
‘switch to Flat Pattern or create one if it doesn’t exist (assumes you have SheetMetal component opened!)
Dim oPartDoc As partdocument
opartdoc = oApp.activedocument
Dim oCompDef As SheetMetalComponentDefinition
ocompdef = opartdoc.componentdefinition
If oCompDef.HasFlatPattern = False Then
oCompDef.Unfold
Else
oCompDef.FlatPattern.Edit
End If
‘get current view transition time
Dim ViewTransTimeCurrent As Double
ViewTransTimeCurrent = oApp.DisplayOptions.ViewTransitionTime
‘set view transition time to 0. Otherwise save happens before the zooming is finished
oApp.DisplayOptions.ViewTransitionTime = 0
‘zoom all
ThisApplication.CommandManager.ControlDefinitions.Item(“AppZoomallCmd”).Execute
‘get reference to active view
Dim oView As View
oView = oApp.ActiveView
‘get ratio between screen view width and height
Dim ratio As Double
ratio = oview.Height/oview.Width
‘calculate thumbnail height
Dim imageHeight As Integer
imageheight = CInt(imagewidth * ratio)
‘get component Part Number
Dim PartNumber As String
PartNumber = iProperties.Value(“Project”, “Part Number”)
‘compose full name of thumbnail
Dim imageFullFileName As String
imageFullFuleName = savepath & partnumber & “.png”