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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

VB_API problems

OsvaldoItaly
4-Participant

VB_API problems

Hi everybody,

i wrote an application on ProE/WF4 vbapi that worked well.

I passed to Creo and i got a big surprise: i cannot connect to any session of creo via VB!!!!

I'm using VS2010 and Creo Elements Pro M080 on Windows 7 and XP SP3, i registered all the variables as said in the "manual" but nothing works.

I post my code

(old version WORKING in WF4, NOT WORKING in Creo)

Dim asynconn As New CCpfcAsyncConnection
Dim conn As IpfcAsyncConnection
Dim session As IpfcBaseSession
conn = asynconn.Connect("", "", ".", 5)
session = conn.Session

(directly from PTC manual, still NOT WORKING in CREO)

Dim connection As IpfcAsyncConnection
Dim classAsyncConnection As New CCpfcAsyncConnection
connection = classAsyncConnection.Connect(DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value)
Dim session As IpfcBaseSession
session = connection.Session

Also the examples in the VB_API folder in Creo do not work.

I need to reach the active session to open a model, selected in an external menu and i need to retrieve the name of the model actually in session.

Does anybody have the same problem? Wayouts?

Tks

Osvaldo Carpina


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.
7 REPLIES 7

Osvaldo

Have you found a solution to this problem?, im trying to solve the same problem and no help from PTC...

Hugo

huggre
1-Newbie
(To:huggre)

OK, i solved the problem myself.

The problem was related to the pfclscom.exe com server not beeing registered correctly.

The fix was to run the vb_api_register.bat as administrator.

After the com server is registered correctly, make sure you update your VB project reference to the new "Creo VB API Type Library for Creo Parametric 2.0"

(You probably did the same mistake as i did by referencing the "Creo Parametric Type Library for Creo Parametric", this is not the correct library)

I am able to get session object with Administrator access but on same system, one of my colleague who is not having admin access rights is getting error of toolkitnotfound exception....

Appreciate any help on this..

Regards

Ketan

Hi

it's a long time i do not use vbapi.

I had the same problem and i solved it giving the .DLL files i referenced in my vb solution the rights for "anyone" to "full" (give it manually)

I'hope this helps you

Regards

Osvaldo

Not able to understand where to give rights..

Can you please elaborate?

Thank you in advance.

Regards

Ketan

Try this procedure

Use the RBM to access properties of pfclscom.exe and go to advanced properties in security tab

Cattura2.JPG

Regards

Osvaldo

Thank you osvaldo .

This I have tried but no success.

I have tried to set enviroment variable PTCNMSPORT as 1239 and then it is giving exception of toolkitcantmodify with Admin rights and working fine without admin access rights.

Regads

Ketan

Top Tags