Binding a label to a model object

Binding a label to a model object

rocio_alvarez9R3F7
Enthusiast Enthusiast
21 Views
6 Replies
Message 1 of 7

Binding a label to a model object

rocio_alvarez9R3F7
Enthusiast
Enthusiast

[ FlexSim 24.1.1 ]

Hello, in my model, I need to create a label called Destino that refers to a 3D element

1725606306005.png

to be able to make an AGV travel to that point in the Flow process.

If I put this: "token.pulled.as(Object).Destino" it takes the name of the object but not its location.

1725605777775.png

but I need to appear this:

1725606417577.png



The route to reach that activity in the processFlow of this process is this:


1725606547732.png


Than you.




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

moehlmann_fe
Observer
Observer
Accepted solution

As long as the object is a direct subnode of the model (not placed inside a plane for example) you can use "Model.find()" to get a reference to the object by name.

Model.find("token.pulled.Destino")
Message 3 of 7

rocio_alvarez9R3F7
Enthusiast
Enthusiast

Hi @Felix Möhlmann, Is there any other way to achieve the same thing without using planes (that the object is on the model) and without having to use Model.find?

Thank you.

0 Likes
Message 4 of 7

moehlmann_fe
Observer
Observer

Having the object inside a plane will make Model.find() not work (at least not in this form). It is a detriment not a requirement.

Where does the "Destino" label on the pulled object come from? Maybe you can replace that with a pointer already.

Another option would be to create a lookup map that links the name to a pointer to the object.

0 Likes
Message 5 of 7

rocio_alvarez9R3F7
Enthusiast
Enthusiast

In my model the "Destino" label refers to these queues.


1725617568150.png

It is a dynamic process where the queue that will be the destination changes depending on where the item enters, that is why I cannot go directly with the pointer.

My question was if knowing that the object that is going to be the "Destino" (the image tails) is in the model is there another way (FlexScript syntax) to express Model.find(token.pulled.Destino).

Thanks.


0 Likes
Message 6 of 7

moehlmann_fe
Observer
Observer
No, the only other way would be to prepare some kind of lookup method in advance, like I suggested doing with a map.

To get a reference to a node by name you use the find() method. (Technically there is also the "node()" command but that is just the deprecated version of find().)

Message 7 of 7

rocio_alvarez9R3F7
Enthusiast
Enthusiast

Thank you for your answers.

kind regards.

0 Likes