question

SudheerReddy avatar image
0 Likes"
SudheerReddy asked Matthew Gillespie commented

Can we Switch the Direction of AGV path using script?

I am just trying to switch the direction of the AGV path using code. Is that possible?

FlexSim 20.1.3
agvflexsim 20.1.3
1592930716318.png (20.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image
3 Likes"
Matthew Gillespie answered Matthew Gillespie commented
function_s(Model.find("AGVNetwork/StraightPath1"), "switchDirection");
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

This code snippet also works for conveyors.

0 Likes 0 ·
tannerp avatar image
2 Likes"
tannerp answered tannerp edited

@Sudheer Reddy,

EDIT: Matthew's method is much better, but I'll leave this here in case you want to change the location or orientation of the paths as well.

To switch the direction of the path, you change the spatialrz value by 180 degrees and adjust the location by the length of the path. I set this up in the example model attached. The path has a length of 10 and is initially set at an x location of 0, so by running the script shown in the image below, it switches the direction 180 degrees while maintaining it's location in 3D space.

switch agv direction.fsm


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.