Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

PorE VB API

sureshy

New member
How to connect with ProE using Proe4.0 VB API . . . ????
smiley5.gif







Edited by: sureshy
 
Dim asyncConnection as pfcls.IpfcAsyncConnection
Dim Casync as New pfcls.CCpfcAsyncConnection
asyncConnection = Casync.Connect (DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value)
session = asyncConnection.Session;

'Function CCpfcAsyncConnection.Connect (Display as String [optional], UserID as String [optional], TextPath as String [optional], TimeoutSec as Long [optional]) as IpfcAsyncConnection
 
Hi forstudy3.
Am using WF 4 and Visual Basic 2008 Express.
I need to start a new proe session in non-graphic
mode.Here's the different versions of the code i've used:

CCAsyCon.Start("D:\ptc\proeWildfire 4.0" + " -
g:no_graphics -i:rpc_input", ".")

CCAsyCon.Start("D:\ptc\proeWildfire 4.0\bin" + " -
g:no_graphics -i:rpc_input", ".")

CCAsyCon.Start("pro -g:no_graphics -i:rpc_input", ".")

Its not connecting with any of the codes.Showing these
messages in the output window:
A first chance exception of type
'System.ArgumentException' occurred in
ConsoleApplication2.exe
A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in
ConsoleApplication2.exe

The proe vb api is referenced correctly.
Can anybody help out?
 
1)Have you checked environment variables "PRO_COMM_MSG_EXE" and "PRO_DIRECTORY".
2)start method should get called as - aSynchConnect = (New CCpfcAsyncConnection).Start(exePath + " -
g:no_graphics -i:rpc_input", ".")
 
Yes the environment variables are correct.And my actual
code is:
CCAsyCon = New CCpfcAsyncConnection
asyncConnection = CCAsyCon.Start(exePath + " -
g:no_graphics -i:rpc_input", ".")

When i run this am getting the error -

"pfcExceptions::XToolkitNoLicense at
pfcls.CCpfcAsyncConnectionClass.Start(String_CmdLine,Obje
ct_TextPath)"

Any clue on this error?
Thanks.
Edited by: hijacker
 
Okay.The above error doesnt show up when i restart my
Flexnet Server.But then after each execution of the
Program,it throwsup the error.Everytime i need to restart
the Flexnet Server.
Edited by: hijacker
 
actually it should not supposed to work this way. Are you getting license exception for all Pro/Toolkit types? or Only for vbapi? What happens if you restart license server and run , does this runs succesfully?

Also note PTC distributes seperate seat for Pro/Toolkit. You can check available ProTk license by running ptcstatus batch file.
 
Hi.ThankYou for your reply.
I've resolved the error.
I forgot to end the session.My license is for a single
user.So whenever a sessions overlaps,an error popped up.So
after completing the operations in each session,the session
needed to be closed and i had forgot to do that!
Working perfect now though a bit slow!:)
Still a doubt persist..cant we use non-graphic mode in
synchronous methods cz asynchronous seems to be pretty
slow?
 

Sponsor

Articles From 3DCAD World

Back
Top