Client Views Apprentice

Client Views Apprentice

tiago.tesche
Participant Participant
253 Views
0 Replies
Message 1 of 1

Client Views Apprentice

tiago.tesche
Participant
Participant

Hello!

I'm trying to follow the inventor api user's manual tutorial about the client views in apprentice, but i get the error below, anyone knows what i'm doing wrong?
the tutorial:

https://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-06D49EB6-7871-4A1B-917F-756735B5D0E7


the code that i have:

 

Public Class Form1

Dim oSvr As InventorApprentice.ApprenticeServerComponent
Dim oAppDoc As InventorApprentice.ApprenticeServerDocument
Dim oClientView As InventorApprentice.ClientView


Private Sub TestApprentice()
' Create a new instance of Apprentice.
Dim oApprentice As New InventorApprentice.ApprenticeServerComponent

' Open a document.'ApprenticeServerComponent
Dim oDoc As InventorApprentice.ApprenticeServerDocument
oDoc = oApprentice.Open("C:\Users\Tiago\Desktop\salvar\CHAPA-15X250X200.ipt")
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
sub1()

End Sub

Private Sub sub1()

Dim filename As String
filename = "C:\Users\Tiago\Desktop\salvar\CHAPA-15X250X200.ipt"
oSvr = New ApprenticeServerComponent
oAppDoc = oSvr.Open(filename)
'MessageBox.Show(oAppDoc.FullDocumentName.ToString)
oClientView = oAppDoc.ClientViews.Add(Picture1.Handle)

End Sub


Private Sub Picture1_Click(sender As Object, e As EventArgs) Handles Picture1.Click

Dim oCamera As Camera
oCamera = oClientView.Camera
oCamera.ViewOrientationType = ViewOrientationTypeEnum.kTopViewOrientation <---- line that gets the error
oCamera.Perspective = True
oCamera.Apply()
Me.Refresh()

End Sub


Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
oClientView.Update(False)
End Sub
End Class

0 Likes
254 Views
0 Replies
Replies (0)