TL;DR
I got a bit excited and wrote half a novel that is most likely out-of-scope.
I don't have exactly what you ask for(I do, but only by analog) but I do have what I consider a better solution.
I, sort of, assume you are running either an add-in or a standalone here, but even if you are not I say you could modify it to work any way. I'm posting the relevant part of the header and the thread spinning the camera around a point.
A simplification would be along the lines of,
InvApp.ActiveView.Camera.Eye , .Target, .Upvector
Followed by
.Apply()
If you actually want a thumbnail, the best way I've found is to save it instead of trying to access the stdole. (If you are running out of process that is)
Public Sub SaveImage()
_Cam.SaveAsBitmap("C:\TEMP\HI-curr.jpg", 600, 600)
_Cam.SaveAsBitmap("C:\TEMP\curr.jpg", 200, 200)
End Sub
This "obviously" requires a full implementation of a structure similar to mine, but that could also be done, "easily".
In-process(with add-in) I have the following
Dim cam As Inventor.Camera = g_inventorApplication.ActiveView.Camera
cam.Fit()
cam.ApplyWithoutTransition()
Try
Dim tclr As Inventor.Color = g_inventorApplication.TransientObjects.CreateColor(80, 80, 80)
Dim bclr As Inventor.Color = g_inventorApplication.TransientObjects.CreateColor(140, 140, 140)
g_inventorApplication.SilentOperation = True
cam.SaveAsBitmap("C:\TEMP\HI-curr.jpg", 600, 600, tclr, bclr)
cam.SaveAsBitmap("C:\TEMP\curr.jpg", 200, 200, tclr, bclr)
g_inventorApplication.SilentOperation = False
Catch ex As Exception
End Try
Try
pctBox.ImageLocation = "C:\TEMP\curr.jpg"
pctBox.Load()
InvPartNr = g_inventorApplication.ActiveDocument.PropertySets.Item(3).Item(2).Value
InvTitle = g_inventorApplication.ActiveDocument.PropertySets.Item(1).Item(1).Value
FileName = g_inventorApplication.ActiveDocument.FullFileName
InvRev = g_inventorApplication.ActiveDocument.PropertySets.Item(1).Item(7).Value
Catch ex As Exception
MessageBox.Show("Err 1: " & vbNewLine & ex.Message)
End Try
The big out-of-process stuff as follows.
Private _Cam As Inventor.Camera
Private _Steps As Integer 'revolution resolution
Private _CamDist As Integer 'Initial target distance
Private _First As Boolean 'Transitioncontrol, set to TRUE when changing target
Private _Target As Inventor.Point
Private x As Double 'Cameraposition X
Private y As Double 'Cameraposition Y
Private z As Double 'Cameraposition Z
Private Sub Spin()
Dim _x As Double 'Angleparameter for target vector
While True
For i As Integer = 1 To _Steps
_x = i / _Steps * (2 * Math.PI)
x = _CamDist * Math.Cos(_x)
z = _CamDist * Math.Sin(_x)
_Cam.Eye = _invApp.TransientGeometry.CreatePoint _
(XCoord:=_Target.X + x, YCoord:=_Target.Y + y, ZCoord:=_Target.Z + z)
_Cam.UpVector = _invApp.TransientGeometry.CreateUnitVector(0, 1, 0)
_Cam.Target = _Target
If _First = True Then
_Cam.Apply()
_First = False
Threading.Thread.Sleep(300)
Else
_Cam.ApplyWithoutTransition()
End If
Next
If _spinning = True Then
End If
End While
End Sub
The folowing is the creation of a new background spinnithingy
Public Sub New(ByVal inventorApp As Inventor.Application,
Optional ByVal Steps As Integer = 360,
Optional ByVal CamDistance As Integer = 100,
Optional ByVal CamHeight As Integer = 75)
Snurr = New Threading.Thread(New Threading.ThreadStart(AddressOf Spin))
_invApp = inventorApp
_Cam = _invApp.ActiveView.Camera
_Steps = Steps
_CamDist = CamDistance
_First = True
y = CamHeight
End Sub
And when the prompt is about to happen I call the following(Yes, I do feel shame about the quad-indentation)
'Find occurrence midpoint
Dim _tx = RefOcc.RangeBox.MaxPoint.X -
((RefOcc.RangeBox.MaxPoint.X - RefOcc.RangeBox.MinPoint.X) / 2)
Dim _ty = RefOcc.RangeBox.MaxPoint.Y -
((RefOcc.RangeBox.MaxPoint.Y - RefOcc.RangeBox.MinPoint.Y) / 2)
Dim _tz = RefOcc.RangeBox.MaxPoint.Z -
((RefOcc.RangeBox.MaxPoint.Z - RefOcc.RangeBox.MinPoint.Z) / 2)
Dim _target As Inventor.Point = _invApp.TransientGeometry.CreatePoint _
(_tx, _ty, _tz)
Try
Spinner.NewTarget(_target)
Catch ex As Exception
'exception handler
Spinner.NewTarget(origin)
End Try