Quantcast
Channel: PTC Community : Unanswered Discussions - Creo
Viewing all articles
Browse latest Browse all 8685

Using VB API with Python

$
0
0

I am trying to use the VB API using Python, but I have trouble importing the IpfcAsyncConnectionmodule.

the PRO_COMM_MSG_EXE environment  variable is correctly set, and I ran "vb_api_register.bat" already.

As a result It works perfectly with the excel vb.application and vb.net.

The Python code is as follows:

 

import win32com.client as win32  

asyncconn = win32.gencache.EnsureDispatch("pfcls.pfcAsyncConnection")

conn = asyncconn.Connect(None,None,None,None)

session = conn.Session

mdlname = session.CurrentModel.FileName;

print mdlname

 

but I get the following error:

 

  File "C:\Anaconda\lib\site-packages\win32com\client\makepy.py", line 320, in

GenerateChildFromTypeLibSpec

    __import__("win32com.gen_py." + dir_name + "." + child)

ImportError: No module named IpfcAsyncConnection


Anything?Anyone???

 

Stephane


Viewing all articles
Browse latest Browse all 8685

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>