Can I add a AGV type in AGV Network Properties in FlexScript?

Can I add a AGV type in AGV Network Properties in FlexScript?

jkhedekar
Enthusiast Enthusiast
111 Views
6 Replies
Message 1 of 7

Can I add a AGV type in AGV Network Properties in FlexScript?

jkhedekar
Enthusiast
Enthusiast

[ FlexSim 23.0.8 ]

I want to automate the repetitive process of creating a AGV network properties by using the script that creates a new AGV network type and sets acceleration and stuff through it.

Thanks.

0 Likes
Accepted solutions (1)
112 Views
6 Replies
Replies (6)
Message 2 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

You'll need something like this:


Object agvNav=Model.find("AGVNetwork");
treenode newAGVType = function_s(agvNav, "addAGVType");
applicationcommand("notifydoclistenersoncustomaction", "AGVNetwork::onAGVTypesChange");
Table speeds=Table(newAGVType.subnodes["speeds"]); 
speeds["Acceleration"]["Empty"]=0.5;
setsdtvalue(newAGVType,"idleAmps",0.5);
Message 3 of 7

jkhedekar
Enthusiast
Enthusiast
How can I tick attach load as trailers with this script?
0 Likes
Message 4 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
setsdtvalue(newAGVType,"trailerAttachRule",1)

You can also access it as a subnode of newAGVType node.

These are the sdt/subnode names:

1694114346655.png

Message 5 of 7

jkhedekar
Enthusiast
Enthusiast

For future purposes, how can I know the subnode names?

0 Likes
Message 6 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Explore the tree of the newAGVType node - it will be under the variable agvTypes. These values could change in the future. They could be given access via the AGV API removing the need to use function_s / set node values.
Message 7 of 7

jkhedekar
Enthusiast
Enthusiast
Thank you!
0 Likes