Watch variable inside an object

jorge_manuel_garcia
Not applicable
0 Views
4 Replies
Message 1 of 5

Watch variable inside an object

jorge_manuel_garcia
Not applicable

[ FlexSim 16.1.2 ]

Hi everyone:

Is there a way to add to the "Watch Variables" list, a variable that is inside an object?

I'd like to add the variable Trip, which is inside InQueue, how can I add it? I tried "InQueue/Trip" and "InQueue/labels/Trip" without success.

2742-image.jpg

Thanks in advance!

Accepted solutions (1)
1 View
4 Replies
Replies (4)
Message 2 of 5

matthew_gillespie
Not applicable
Accepted solution

You can just use the getlabel command:

getlabel(current, "Trip")
Message 3 of 5

jorge_manuel_garcia
Not applicable

Thanks Matthew, but if the object is not "current"? can I reference it by the name?

0 Likes
Message 4 of 5

matthew_gillespie
Not applicable

No, but you can reference objects by path using the node command:

node("InQueue", model())

So to get the label you'd say:

getlabel(node("InQueue", model()), "Trip")

Or you could just use the path to the label:

getnodenum(node("InQueue>labels/Trip", model()))
0 Likes
Message 5 of 5

joerg_vogel
Not applicable

Or you try to use the sampler. You write your code until you need an object's reference, then you pick the Sampler and move the pipette icon ( eye dropper element) over this object you want to point and click the left mouse button. Then a list pops up and you choose a suggestion from the items of node. After the reference is put to your code, you write on the code.

Maybe it become obvious what I tried to show in the video at time stamp 5:44 or this video at 3:37. The time stamp is already set in the link.