question

Aline L2 avatar image
0 Likes"
Aline L2 asked Felix Möhlmann answered

Visual Text - TOTAL TRAVEL

Hi! I Need Help.

I'm Trying To Use Visual Text To Show Some Things Without Having To Create A Panel, But I Don't Know How To Do It.

For Example: I Have An Agv That Collects And Delivers Loads At Several Points, Would You Like To Show In The Visual Text The "Total Travel Dist" Is It Possible?

I Also Wanted To Show The Value Of A Variable Or Line And Column Of A Global Table Is It Possible?foto1.png

FlexSim 21.2.0
text
foto1.png (64.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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can display any value in the model by leaving the setting of the text object at "Display Text" and type a reference to that value in the text field. If the value is a number, you have to use the "string.fromNum()" command to convert it into a string (text).

The travel distance of a task executer can be accessed with

Model.find("TE_Name").as(Object).stats.totalTravelDistance

The complete syntax to display it on a text object would thus be

string.fromNum(Model.find("TE_Name").as(Object).stats.totalTravelDistance, 2)
// The "2" is the number of decimal places to display

For a global table value you'd use

string.fromNum(Table("TableName")[row][col])

You can add together multiple strings with a "+" inbetween. For example to display a text in front of the value. Remember to enclose literal text in " ".

"Table Value: " + string.fromNum(Table("TableName")[row][col])


One last tip: If typing a long expression into the small field gets annoying, you can open the code editor for that field and type the expression in the line that starts with "return" more comfortably.

1632902927081.pngTextDisplay.fsm


1632902927081.png (9.1 KiB)
textdisplay.fsm (36.4 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.

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.