Hi @K.TRYFONIDIS
Here is a version that selects the XZ Plane, and looks at it before saving the part files. I know you asked for a perspective view, and this sets an end view, but this approach might work. If not we can likely set the camera view to an specific iso view instead of looking an origin plane. I'll try to post back an example of that later as well.
You might need to add some logic to help it know which parts to do this for, so that not all parts will have that view, but I think something like this example would be the way to go.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
'get current color scheme name
oColorScheme = ThisApplication.ActiveColorScheme.Name
'get current color scheme background type
oBackGroundType = ThisApplication.ColorSchemes.BackgroundType
'Change to Presentation (white background)
ThisApplication.ColorSchemes.Item("Presentation").Activate
'set to use one color background type
ThisApplication.ColorSchemes.BackgroundType = _
BackgroundTypeEnum.kOneColorBackgroundType
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
Dim oDoc As Document
Dim oRefFile As FileDescriptor
For Each oDoc In oAsmDoc.AllReferencedDocuments
ThisApplication.Documents.Open(oDoc.FullFileName, True)
For Each oSketch In oDoc.ComponentDefinition.Sketches
oSketch.Visible = False
Next
'set work plane visibility
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
oWorkPlane.Visible = False
Next
'set work axis visibility
For Each oWorkAxis In oDoc.ComponentDefinition.WorkAxes
oWorkAxis.Visible = False
Next
'set work point visibility
For Each oWorkPoint In oDoc.ComponentDefinition.WorkPoints
oWorkPoint.Visible = False
Next
Dim oDef As PartComponentDefinition
oDef = oDoc.ComponentDefinition
oDoc.SelectSet.Clear
'select plane
oDoc.SelectSet.Select(oDef.WorkPlanes.Item("XZ Plane"))
Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions("AppLookAtCmd")
ThisApplication.ActiveView.Fit
oCtrlDef.Execute
'set iproperty to use current view on save
oDoc.SetThumbnailSaveOption _
(ThumbnailSaveOptionEnum.kActiveWindowOnSave)
'try to save
Try
oDoc.Save
Catch
'catch error and do nothing
End Try
'close the file
oDoc.Close
Next
'Change back to original scheme
ThisApplication.ColorSchemes.Item(oColorScheme).Activate
'Change back to original back ground type
ThisApplication.ColorSchemes.BackgroundType = oBackGroundType
