Hi, if anyone can help me unscramble this exception report from Python I'd be hugely grateful. All I'm trying to do is carry out is call VISUM and carry a flow bundle. I think the problem may be with the Python installation rather than the script.
Many thanks,
Stephen
I've got the following code:
------------------------------------------
And then this is the error message I get:
File "C:\Python25\Li b\site-packages\Python win\pywin\frame work\scriptutil s.py", line 309, in RunScript
debugger.run(co deObject, __main__.__dict __, start_stepping= 0)
File "C:\Python25\Li b\site-packages\Python win\pywin\debug ger\__init__.py ", line 60, in run
_GetCurrentDebu gger().run(cmd, globals,locals, start_stepping)
File "C:\Python25\Li b\site-packages\Python win\pywin\debug ger\debugger.py ", line 624, in run
exec cmd in globals, locals
File "Y:\07 Forecasting\10 Review of Highway Model\Test\Oa_O riginal_SLA.py" , line 21, in <module>
netElem.add(lin k)
File "C:\Python25\li b\site-packages\win32c om\client\__ini t__.py", line 454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr)
AttributeError: '<win32com.gen_ py.Visum Object Library 11.5.INetElemen ts instance at 0x22624096>' object has no attribute 'add'
>>>
Many thanks,
Stephen
I've got the following code:
Code:
import VisumPy.helpers
#from VisumPy.helpers import CreateVisum
Visum = VisumPy.helpers.CreateVisum(115)
fileNames = ["Base06_AM_DS"]
for fileName in fileNames:
Visum.LoadVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
#flow bundle execute and save matrix
fn = 119545498
tn = 119545499
# UC1
dseg = "UC1"
filename = "Y:/07 Forecasting/10 Review of Highway Model/Test/AA16DS_AM_SLA1_NB_UC1_F.mtx"
netElem = Visum.CreateNetElements()
link = Visum.Net.Links.ItemByKey(fn, tn)
netElem.add(link)
fb = Visum.Net.DemandSegments.ItemByKey(dseg).FlowBundle
fb.Execute(netElem)
fb.Save(filename,"O")
# Visum.Procedures.Execute()
Visum.SaveVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
And then this is the error message I get:
File "C:\Python25\Li b\site-packages\Python win\pywin\frame work\scriptutil s.py", line 309, in RunScript
debugger.run(co deObject, __main__.__dict __, start_stepping= 0)
File "C:\Python25\Li b\site-packages\Python win\pywin\debug ger\__init__.py ", line 60, in run
_GetCurrentDebu gger().run(cmd, globals,locals, start_stepping)
File "C:\Python25\Li b\site-packages\Python win\pywin\debug ger\debugger.py ", line 624, in run
exec cmd in globals, locals
File "Y:\07 Forecasting\10 Review of Highway Model\Test\Oa_O riginal_SLA.py" , line 21, in <module>
netElem.add(lin k)
File "C:\Python25\li b\site-packages\win32c om\client\__ini t__.py", line 454, in __getattr__
raise AttributeError, "'%s' object has no attribute '%s'" % (repr(self), attr)
AttributeError: '<win32com.gen_ py.Visum Object Library 11.5.INetElemen ts instance at 0x22624096>' object has no attribute 'add'
>>>
Comment