How can I get the state of the detector from the COM interface of VISSIM?
How to get the detector information from the COM interface of VISSIM
514 views Asked by Ben At
2
There are 2 answers
1
On
I have no idea about C#, but I know how to get the state of detectors from COM-interface of VISSIM.
sim = CreateObject("VISSIM.Vissim.700")
Detector=sim.net.Detectors
Set deton = dets.itembykey(1)
if you want to know, whether the detector is impulse or not
a=deton.attvalue("Impulse")
if you want to know, the speed of vehicles which is detected by this detectors then
b=detup1.attvalue("VehSpeed")
Then output the resu
guiSheet.Range("a1").Value = a
guiSheet.Range("b1").Value = b
Please pay attention, you have to define guiSheet as follows
guiSheet = Worksheets("VISSIM")
Then you can get the status of detector in VISSIM. In addition to speed and Impulse state, you also can find a lot of other states, e.g., occupancy.
I am also a beginner of VISSIM COM-Interface, hope the answer is helpful for you:)
Detectors, or as Vissim calls it, Data Collection Measurements can be fetched from COM using the command:
Then you can check for the required values, if equipped using this command:
This will retrieve the current average speed for all the lanes.