Skip to main content
1-Visitor
July 15, 2011
Solved

Setting Up VB API

  • July 15, 2011
  • 3 replies
  • 24068 views

All,

I am attempting to setup/install the VB API component for Wildfire 5.0 on an XP machine.

  1. I set PRO_COMM_MSG_EXE to the pro_install\i486_nt\obj\pro_comm_msg.exe
  2. I ran ptcsetup.bat and installed the VB API
  3. I ran vb_api_register.bat, and am receiving the following error:
    1. "pro_install\i486_nt\obj\pfclscom.exe" is not recognized... yada yada translation it's not there. In fact, it is nowhere on my machine.

Any ideas?

Thanks in advance,

Matt Wright

Best answer by sgudla

Hi Matt,

It cannot happen that a "vb_api_register.bat" exist in the bin folder and the pfclscom.exe is missing. This clearly tells me that the installion was incomplete.

So, could you please try reinstalling the product with Vb API component selected? This should fix your problem.

Thanks,

Seshu Kumar

Principal Engineer

Technical Support.

3 replies

1-Visitor
December 16, 2011

Matt,

Did you ever figure this out? I am seeing the same problem on my computers.

Thanks,

Mark Bohannon

sgudla18-OpalAnswer
18-Opal
March 11, 2013

Hi Matt,

It cannot happen that a "vb_api_register.bat" exist in the bin folder and the pfclscom.exe is missing. This clearly tells me that the installion was incomplete.

So, could you please try reinstalling the product with Vb API component selected? This should fix your problem.

Thanks,

Seshu Kumar

Principal Engineer

Technical Support.

1-Visitor
November 8, 2013

Hello Mr Seshu,

i have written this code but i am not connect with vb to proe and not opening the model through vb.net what chan I do Plz help me i had written this code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Dim componentFeat As pfcls.IpfcComponentFeat

'MsgBox("Feature number: " & componentFeat.Number)

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("D:\Program Files\proeWildfire 4.0\bin\proe.exe" + " -g:no_graphics -i:rpc_input", ".")

session = asyncConnection.Session

asyncConnection.Session.ChangeDirectory("D:\Test_Proe")

Dim descModel As IpfcModelDescriptor

Dim model As IpfcModel

descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_PART, "D:\ProEExample\test.prt", Nothing)

model = session.RetrieveModel(descModel)

Catch ex As Exception

MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)

Finally

If Not asyncConnection Is Nothing AndAlso asyncConnection.IsRunning Then

asyncConnection.End()

End If

End Try

End Sub

18-Opal
November 8, 2013

Hi Mohit,

To have a successful connection with Proe, you need to set PRO_COMM_MSG_EXE environment variable with correct path. Below is the documentation excerpt from VB API documenation. Please refer to this topic on how to set this environment variable. If you have a PTC.com user account, you could find technical articles on this in our Knowledge base. Try this and let me know.

Also, one should pass only the model name without the extension or path to (New CCpfcModelDescriptor).Create() function (second argument). The size limit for this string is 40 (39 + end of line).

Thanks,

Seshu

Setting Up a VB Application

For your application to communicate with Creo Elements/Pro, you must set the PRO_COMM_MSG_EXE environment variable to the full path of the executable, pro_comm_msg.exe. Typically, the path to the executable is [creo_loadpoint]/[machine type]/obj/pro_comm_msg.exe, where machine type is i486_nt for 32-bit Windows and x86e_win64 for 64-bit Windows installations.

Set PRO_COMM_MSG_EXE as:

    1. Click Start > Settings > Control Panel
    1. Click System. The System Properties windows opens.
    2. In the Advanced tab, click the Environment Variables button.
    3. Add PRO_COMM_MSG_EXE to System variables.

Registering the COM Server

To register the COM server, run the vb_api_register.bat file located at [creo_loadpoint]/bin.

To unregister the COM server, run the vb_api_unregister.bat file located at [creo_loadpoint]/bin.

After the COM server is registered with the system, whenever an application tries to access the types contained in this server the server starts automatically. By default, Windows starts services such as pfclscom.exe in the Windows system directory (c:\winnt\system_32). Because the server will also start new sessions of Creo Elements/Pro from the process working directory, you may want to control the server run directory. You can configure the server to start in a specific directory by setting the system environment variable PFCLS_START_DIR to any existing directory on your computer.

1-Visitor
October 28, 2014

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

1-Visitor
October 28, 2014

Hi

In general, running VBA apps in Creo does not require any local admin permissions.

However, before you can run any VBA apps you need to run the vb_api_register.bat on all clients; and this will typically require local admin (this .bat registers some DLL's required by the API)

The thing is that if you run the vb_api_register.bat on a client without local admin permissions there is no error message displayed and you may assume that everything is OK while in fact it is not.

1-Visitor
October 29, 2014

Hi,

Thank you very muech for your concern on this issue.

We have run vb_api_register.bat with local admin permissions and same is allowing us to build project.

Issue we are facing is as below in detail:

Case - 1 :

- Working fine with Admin Permission but not working without admin permission. Exception we got is the different one for different users. One is getting toolkitcantmodify whereas other fellow is getting toolkitnotfound exceptions.

All of us are using same system and same code. We are running application from source code rather than double clicking on application executable.

Case - 2 :

- Working fine with Admin Permission as well as without admin permission on different computer used in case - 1. These all users are also referring same code which are used by people of case - 1 and runs application from source code.

Case - 3 :

- Not Working fine with Admin Permission as well on client location. These all users are also referring same code which are used by people of case - 1 and runs application using application executable.

To conclude, as per my understanding, it has nothing to do with admin permission once we have registered bat file. This has something to do with users and systems but i m not able to figure out what is missing.

Any help on this is most welcome.

Thanks and Regards

Ketan