473,669 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python / Visum Error Message

1 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. import VisumPy.helpers
  2. #from VisumPy.helpers import CreateVisum
  3.  
  4. Visum = VisumPy.helpers.CreateVisum(115)
  5. fileNames = ["Base06_AM_DS"]
  6.  
  7. for fileName in fileNames: 
  8.     Visum.LoadVersion(r"Y:/07 Forecasting/10 Review of Highway Model/Test/" + fileName)
  9.  
  10. #flow bundle execute and save matrix
  11.  
  12. fn = 119545498
  13. tn = 119545499
  14.  
  15. # UC1
  16. dseg = "UC1"
  17. filename = "Y:/07 Forecasting/10 Review of Highway Model/Test/AA16DS_AM_SLA1_NB_UC1_F.mtx"
  18. netElem = Visum.CreateNetElements()
  19. link = Visum.Net.Links.ItemByKey(fn, tn)
  20. netElem.add(link)
  21. fb = Visum.Net.DemandSegments.ItemByKey(dseg).FlowBundle
  22. fb.Execute(netElem)
  23. fb.Save(filename,"O") 
  24.  
  25. #   Visum.Procedures.Execute()
  26. 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'
>>>
Jan 30 '12 #1
1 3757
Smygis
126 New Member
I can't find documentation on this module so im not sure whats going on. (PTV.de? my german is not good enough to figure out if the site is relevant)

What you could do is open up a python window and run the program line by line until you get to
Expand|Select|Wrap|Line Numbers
  1. netElem = Visum.CreateNetElements()
And then run:
Expand|Select|Wrap|Line Numbers
  1. dir(netElem)
And see what happens. The error seems to be about it not having a .add(), and i suppose if it looks strange that module might be corrupt or something.
Feb 1 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1117
by: ajikoe | last post by:
I found this error message when I import pylab. from pylab import * Error message: Microsoft Visual C++ Runtime Library Assertion failed! Program:c\python24\python.exe File:CXX/cxx_extentions.cxx Line:1031
5
4375
by: Madhu R. Vajrala | last post by:
Hello All, I am very new to Python, trying to install it from source (ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/python-2.3.3.tar.gz) on Sun Solaris-9 (SPARC). But getting the below error message during configure. Also while uncompressing, it is returning the checksum doesnt match error as well. Configure Error:
5
1557
by: Jon Guyer | last post by:
>>> This is a fake line to confuse the stupid top-posting filter at gmane We have a rather complicated class that, under certain circumstances, knows that it cannot perform various arithmetic operations, and so returns NotImplemented. As a trivial example: >>> class my: ... def __mul__(self, other): ... return NotImplemented ...
26
3225
by: Christoph Zwerschke | last post by:
You will often hear that for reasons of fault minimization, you should use a programming language with strict typing: http://turing.une.edu.au/~comp284/Lectures/Lecture_18/lecture/node1.html I just came across a funny example in which the opposite is the case. The following is a binary search algorithm in Java. It searches a value in an ordered array a of ints: public static int binarySearch(int a, int key) {
8
2128
by: Claudio Grondi | last post by:
Here an example of what I mean (Python 2.4.2, IDLE 1.1.2, Windows XP SP2, NTFS file system, 80 GByte large file): Traceback (most recent call last): File "<pyshell#1>", line 1, in -toplevel- f = file('veryBigFile.dat','r+') IOError: No such file or directory: 'veryBigFile.dat'
2
1629
by: redefined.horizons | last post by:
I've written a few classes that I have been testing in IDLE. However, every time I make a change to the classes based on the testing I have to walk through all he steps of preparing the classes for testing again. So I wrote a script that does all the set-up work for me. The only problem is when I run this script using the Python interpreter I can't get the command prompt to stay up long enough for me to read the message.
1
4346
by: Prof Rodney Coates | last post by:
Although I have been using Macs for a quarter of a century and was doing scientific programming in the '60's I am VERY new to Python on the Mac. I have been writing some very simple applications and running them using IDLE. To start with the applications worked OK. However, as time has progressed, the error message "ImportError: No module named ****" has been generated with increasing frequency. It has now become impossible to use Python...
0
849
by: Steve Holden | last post by:
Ahmed, Shakir wrote: The error is at line 317 of your script. . Are you using the ctypes library, or some other extension module? It may be that in invalid pointer is causing problems for the garbage collector during shutdown, for example. regards Steve --
0
1019
by: Keith Bailey | last post by:
Dear All, Any help on this would be hugely appreciated. I have had a Python programme written for me, but when I try to run it, I get the following error message: /*Traceback (most recent call last): File "iTeddyConverter.py", line 3, in <module> File "zipextimporter.pyc", line 82, in load_module
5
2701
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me what the fix is. Thanks.
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.