question

Hannah avatar image
0 Likes"
Hannah asked Matthew Gillespie answered

How to reference object as AGV?

I'd like to use some of the properties under the AGV class but don't know how to reference an object as an AGV. The objects I'm using are task executers attached to an AGV network.


Here my current code:

AGV agv1 = Model.find("TaskExecuter1");

This is the error I'm getting:

FlexScript exception: Invalid down cast. Object is not an instance of the target type.

FlexSim 22.2.2
agvflexscriptagvnetwork
5 |100000

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

1 Answer

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

You need to use the AGV() constructor:

AGV agv1 = AGV(Model.find("TaskExecuter1")); 
5 |100000

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