Views:

Question

How to create a flow bundle based upon a PuT assignment by using COM, using multiple conditions, linked by "OR"?

Answer

Example:

aFlowBundlePuT = Visum.Net.FlowBundle
aFlowBundlePuT.Clear()
aFlowBundlePuT.DemandSegments = "PT"
aStopPoint1 = Visum.Net.StopPoints.ItemByKey(442)
AnActivityTypeSet1 = aFlowBundlePuT.CreateActivityTypeSet()
AnActivityTypeSet1.Add(21) # Only 1 ("Origin traffic") + 4 ("Boarding passengers") + 16 ("Transfers")
aFlowBundlePuT.CreateCondition(aStopPoint1, AnActivityTypeSet1)
aFlowBundlePuT.CreateNewGroup() # This creates an "external OR"
aStopPoint2 = Visum.Net.StopPoints.ItemByKey(66)
AnActivityTypeSet2 = aFlowBundlePuT.CreateActivityTypeSet()
AnActivityTypeSet2.Add(21)
aFlowBundlePuT.CreateCondition(aStopPoint2, AnActivityTypeSet2)
aFlowBundlePuT.ExecuteCurrentConditions()