Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

ClientView IDW

NachitoMax
Advisor
Advisor

ClientView IDW

NachitoMax
Advisor
Advisor

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

EESignature


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.


0 Likes
Reply
461 Views
2 Replies
Replies (2)

NachitoMax
Advisor
Advisor

Well....

 

No matter what apprentice method I use, I get the exact same error. furthermore, an earlier separate application that did work just fine in 2017 no longer works. All of the samples (including my live application) error on this line

 

apprentice issue.jpg

 

and the error is

Exception thrown: 'System.Runtime.InteropServices.COMException' in mscorlib.dll

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

 

I have tried everything from threading to using the inventor viewer all of which return the same error.

 

So,

 

is this an error in Inventor? Are there some additional files that are required? I have copied over the following files over to the 2017 folder

adskassetapi_new-5.2.dll

adskassetapi_new-15.dll

libeay32_Ad_1.dll

ssleay32_Ad_1.dll

 

the project is currently x86 platform

 

I will obviously need to get this fixed in my existing application too... Anyone else had experience with this and managed to fix it?

 

 

 

Cheers

 

Nacho

 

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


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.


0 Likes

itB9559
Participant
Participant

Hi, Sorry to reply to an old topic, but did you ever find a solution to this?

0 Likes