Hi Brian
UPDATE
Are you saying then that if Inventor was already open and I used the supplied code (even though the code exclusively uses Apprentice only), it wont work? I have tried the code this evening and I get an error:

And here is the full error
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NotImplementedException: Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.ApprenticeServerDocument.get_Thumbnail()
at oSheets.pAssyStructure.LoadImage(String sPath) in C:\Users\Nige\Documents\Visual Studio Projects\Inventor\oSheets\oSheets\Pages\pAssyStructure.vb:line 110
at oSheets.pAssyStructure.GridControl1_Click(Object sender, EventArgs e) in C:\Users\Nige\Documents\Visual Studio Projects\Inventor\oSheets\oSheets\Pages\pAssyStructure.vb:line 100
at System.Windows.Forms.Control.OnClick(EventArgs e)
at DevExpress.XtraGrid.GridControl.OnClick(EventArgs ev)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
at DevExpress.XtraGrid.GridControl.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
So, I added this to my click Event
Dim apprentice = New Inventor.ApprenticeServerComponent
Dim doc As Inventor.ApprenticeServerDocument = apprentice.Open(sPath)
Dim picDispThumb As stdole.IPictureDisp = doc.Thumbnail
Dim imageThumb As Image = AxHostConverter.PictureDispToImage(picDispThumb)
I then added this after the form Class
Public Module Utilities
Friend Class AxHostConverter
Inherits AxHost
Private Sub New()
MyBase.New(GetType(stdole.IPictureDisp).GUID.ToString)
End Sub
Public Shared Function PictureDispToImage(pictureDisp As stdole.IPictureDisp) As Image
Return GetPictureFromIPicture(pictureDisp)
End Function
Public Shared Function ImageToPictureDisp(image As Image) As stdole.IPictureDisp
Return DirectCast(GetIPictureDispFromPicture(image), stdole.IPictureDisp)
End Function
End Class
End Module
I also tried in a separate Module and also a Class all of which, gave me the same error
Thanks
Nacho
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.