Subject: Re: Access the WEAP API via python. Posted: 8/3/2015 Viewed: 8662 times
I know this is an old topic but better than creating a new one, I believe.
I downloaded the pywin32 package and installed it successfully, but still unable to use WEAP API. By searching through website I didn't get anything. Adding other APIs e.g. MSExcel,MSWord,.. can be done very simply but I have problem adding WEAP API. Any help will be appreciated.
Traceback (most recent call last):
File "", line 1, in
File "C:\Python34\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python34\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)
Subject: Re: Access the WEAP API via python. Posted: 8/4/2015 Viewed: 8603 times
Well, After 2 days of search and surfing the internet, I finally found that WEAP does not automatically "register" itself.
For registering manually just open Windows "Command Prompt" as Administrator, Go to WEAP install directory (e.g. C:\Program Files\WEAP) and simply run the following command:
After registering, accessing API trough python is never easier than before.
Subject: Re: Access the WEAP API via python. Posted: 8/11/2016 Viewed: 3928 times
I want to know if i need close WEAP from python later Calculate and Saving How I can do it?
Subject: Re: Access the WEAP API via python. Posted: 8/11/2016 Viewed: 3923 times
I'm not sure that I understood your question, but I will direct you to the WEAP Help menu (open up WEAP, and on the ribbon at the top, go to Help/Contents). There, under "Advanced Topics" you will find a detailed section called "Automating WEAP (API)." The subsection "WEAP Application Class" contains several of the commands you may be looking for, including WEAP.Calculate and WEAP.SaveArea.