ClientView IDW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I managed to get this working in a previous application but the identical code does not work.... I get an error
Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll
on this line
m_PopoView.Update(False)
Here is my full code
Private Sub LoadImage() Dim sSheet As Integer = 0 m_oDrawingDocument = m_oServer.Open(s) m_PopoView = m_oDrawingDocument.Sheets.Item(1).ClientViews.Add(PictureBox1.Handle.ToInt32()) m_PopoCamera = m_PopoView.Camera m_PopoCamera.Perspective = False m_PopoCamera.Fit() m_PopoCamera.Apply() m_PopoView.Update(False) Try m_oDrawingDocument.Close() m_oDrawingDocument = Nothing Catch ex As Exception End Try End Sub
and here a version I found from Sanjay that also doesn't work....
Dim oSvr As InventorApprentice.ApprenticeServerComponent Dim oAppDoc As InventorApprentice.ApprenticeServerDrawingDocument Dim oClientView As InventorApprentice.ClientView Private Sub Form_Load() Dim filename As String = "I:\2017\Z Templates\company\company - Drawing Sheet.idw"
oSvr = New Inventor.ApprenticeServerComponent oAppDoc = oSvr.Open(filename) Dim oSheet As Inventor.Sheet oSheet = oAppDoc.Sheets.Item(1) oClientView = oSheet.ClientViews.Add(PictureBox1.Handle.ToInt32()) End Sub Private Sub loadimage() Dim oCamera As InventorApprentice.Camera oCamera = oClientView.Camera oCamera.Fit() oCamera.Perspective = False oCamera.Apply() Me.Refresh() End Sub Private Sub Form_Paint() oClientView.Update(False) End Sub
Any ideas what might cause the issue and how I can rectify it?
cheers
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.
Link copied