Many thanks,
Stephen
I've got the following code:
Expand|Select|Wrap|Line Numbers
- 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\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py" , line 309, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\__init__.py", line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\Python25\Lib\site-packages\Pythonwin\pywin\debugger\debugger.py", line 624, in run
exec cmd in globals, locals
File "Y:\07 Forecasting\10 Review of Highway Model\Test\Oa_Original_SLA.py", line 21, in <module>
netElem.add(link)
File "C:\Python25\lib\site-packages\win32com\client\__init__.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.INetElements instance at 0x22624096>' object has no attribute 'add'
>>>