question

Jorge Manuel Garcia avatar image
1 Like"
Jorge Manuel Garcia asked Joerg Vogel edited

Watch variable inside an object

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.

Thanks in advance!

FlexSim 16.1.2
debuggingvariabledebug
image.jpg (18.6 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.

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Joerg Vogel edited

You can just use the getlabel command:

getlabel(current, "Trip")
· 3
5 |100000

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

Jorge Manuel Garcia avatar image Jorge Manuel Garcia commented ·

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

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Jorge Manuel Garcia commented ·

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.

1 Like 1 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jorge Manuel Garcia commented ·

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 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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