cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ProE API VB starting the app

ptc-2037692
1-Newbie

ProE API VB starting the app

I am using Vista Ultimate and Visual Studio 2005. I have followed the instructions in regards to setting up the PRO_COMM_MSG_EXE environment variable and running the batch file to register the COM server (vb_api_register.bat) I think I have done everything right, but when I run the example code I get an error: pfsExceptions::XToolkitGeneralError Imports pfcls Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click runProE("C:\Program Files\proeWildfire 4.0\bin\proe.exe", "C:\") End Sub Public Sub runProE(ByVal exePath As String, ByVal workDir As String) Dim asyncConnection As IpfcAsyncConnection = Nothing Dim cAC As CCpfcAsyncConnection Dim session As IpfcBaseSession Try '====================================================================== 'First Argument : The path to the Pro/E executable along with command 'line options. -i and -g flags make Pro/ENGINEER run in non-graphic, 'non-interactive mode 'Second Argument: String path to menu and message files. '====================================================================== cAC = New CCpfcAsyncConnection asyncConnection = cAC.Start(exePath, ".") session = asyncConnection.Session '====================================================================== 'Set working directory '====================================================================== asyncConnection.Session.ChangeDirectory(workDir) '====================================================================== 'VB api process calls and other processing to be done '====================================================================== Dim descModel As IpfcModelDescriptor Dim model As IpfcModel descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_PART, "partModel.prt", Nothing) model = session.RetrieveModel(descModel) Catch ex As Exception MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString) Finally '====================================================================== 'End the Pro/ENGINEER session when done '====================================================================== If Not asyncConnection Is Nothing AndAlso asyncConnection.IsRunning Then asyncConnection.End() End If End Try End Sub End Class Can somebody tell me what I am doing wrong? thanks
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

solved. the path to the file was the problem along with the working directory. Found out that I can only use the file name and not the whole path and that I have to set the working directory to the one where the file is before i can open it.

Same problem here. I did everything what the manual said. I'm working with MS Excel 2003. I don't quite understand how you solved the problem, can you maybe explain it to me in more detail please. Thanks
Announcements
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.

NEW Creo+ Topics:
PTC Control Center
Creo+ Portal
Real-time Collaboration