Using Python as the script language

A distinguishing feature of Python is its clear and understandable syntax. With this you can conveniently set up a prompt which is tailored to your project.

Python and all of the additional libraries are open source programs without usage restrictions.

When installing Vissim, Python is installed to the ..\Exe\Python directory by default.

 

Tip: You can download a current PTV Vision Python setup from the PTV website:

 https://cgi.ptvgroup.com/php/vision-setups/

 

Notes:  

  • You must install Python 3.9 or a higher version and the appropriate extension PythonWin, which provides Python with the COM functionality.
  • Python 3.9 and the appropriate extension PythonWin must correspond to your Vissim version, e.g. python-3.9.6.amd64.exe and pywin32-301.win-amd64-py3.9.exe for the 64-bit edition of Vissim.
  • The wrapper wxPython is not supported.
  • The Python distribution anaconda is not supported.
Example of a *.pys script file
all_flows = Vissim.Net.VehicleInputs.GetAll()
for i in range(len(all_flows)):
all_flows[i].SetAttValue("Volume(1)", 0.5 * all_flows[i].AttValue("Volume(1)"))

Superordinate topic:

Using the COM Interface