Views:

Question

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

Answer

Example:

aFlowBundlePrT = Visum.Net.FlowBundle
aFlowBundlePrT.Clear()
aFlowBundlePrT.DemandSegments = "C"
aNode1 = Visum.Net.Nodes.ItemByKey(444)
AnActivityTypeSet1 = aFlowBundlePrT.CreateActivityTypeSet()
AnActivityTypeSet1.Add(1) # Only "Origin traffic"
aFlowBundlePrT.CreateCondition(aNode1, AnActivityTypeSet1)
aFlowBundlePrT.CreateNewGroup() # This creates an "external OR"
aNode2 = Visum.Net.Nodes.ItemByKey(159)
AnActivityTypeSet2 = aFlowBundlePrT.CreateActivityTypeSet()
aFlowBundlePrT.CreateCondition(aNode2, AnActivityTypeSet2)
aFlowBundlePrT.ExecuteCurrentConditions()