Two Way Path

how to change the direction of a 2-way-path with python script ?
Thanks in advance

I have shared simple script to change direction of Two way path by using boolean signal

DirectionFwd → Boolean signal
conveyor_full - > Boolean signal
" conveyor_full let you detect when the part is left from the path . " If you don’t need to monitor parts on conveyor you can delete OnPhysicalTransition event

from vcScript import *

def OnSignal( signal ):

global path,conv_direction

if signal.Name == “DirectionFwd” and signal.Value == True:

path.Enabled = False

path.Direction = VC_PATH_FORWARD

path.Enabled = True

elif signal.Name ==“DirectionFwd” and signal.Value == False:

path.Enabled = False

path.Direction = VC_PATH_BACKWARD

path.Enabled = True


def OnStart():

global path

path.Direction = VC_PATH_FORWARD_AUTO

def trans(cont, _part, arrive):

global part, conv_full

if arrive:

part= _part


elif arrive ==False:

part = None 


comp= getComponent()

path = comp.findBehaviour(“TwoWayPath”)

conv_full= comp.findBehaviour(“conveyor_full”)

path.OnPhysicalTransition = trans

1 Like

Thank you very much !!!