Display Simulation Time as Text or bill board in 3D space

Display Simulation Time as Text or bill board in 3D space

karthikeyan_b
Not applicable
237 Views
7 Replies
Message 1 of 8

Display Simulation Time as Text or bill board in 3D space

karthikeyan_b
Not applicable

[ FlexSim 19.1.0 ]

19693-time.png

Hello

I was wondering if there is a way to just get the real runtime clock to display as a text in the 3D model for easy viewing.

I am trying to add the simualtion timer next to some 3D objects to see how it reacts based on time.

I was able to customize the clock as shown in the picture but it counts in minutes and seconds.

I have seen this example shown below in the Q and A forum but was not able to use that in the code.

Can some one show me an example ?

getmodelunit(CURRENT_TIME) //Returns FS_DATETIME
time() //Returns model time
convert(time(), MODEL_TIME, DATETIME_STR) //Will print out date time based upon the date/time format string, for example 8:00:00 AM Fri 24 Jun 2016
0 Likes
Accepted solutions (1)
238 Views
7 Replies
Replies (7)
Message 2 of 8

Matthew_Gillespie
Autodesk
Autodesk

What format do you want it to display in? Did you try the Use Default Format option?



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 8

karthikeyan_b
Not applicable

Hello Matt , I am trying to display it in seconds.

2400000.00 seconds ~ 66 Hrs

SSSSSS.SS

0 Likes
Message 4 of 8

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

In the Text object's Display Text field put this line of code:

textnode.value = string.fromNum(getmodelunit(CURRENT_SECOND), 2);

Or if you just want it to display in whatever units the model is using you could do

textnode.value = string.fromNum(Model.time, 2);

See this example model.

timedisplay.fsm



Matthew Gillespie
FlexSim Software Developer

Message 5 of 8

karthikeyan_b
Not applicable

Brilliant , Thank you @Matthew Gillespie

0 Likes
Message 6 of 8

PaulPNEM4H
Explorer
Explorer

how to display hh:mm:ss? instead.

0 Likes
Message 7 of 8

moehlmann_fe
Enthusiast
Enthusiast

That should mostly be the default. Fust choose the "Display Date and Time" option for a billboard text. Then use "Custom Format" and remove the date. "HH" is 24-hour day, "hh" is 12-hour day. In which case you would probably want to use "hh:mm:ss tt" to also display AM/PM.

moehlmann_fe_0-1757053786744.png

 

0 Likes
Message 8 of 8

PaulPNEM4H
Explorer
Explorer

 

There is a scenario where empty totes arrive and wait on the conveyor until the operator loads all items from another source into them. Once all totes are loaded, they move together at the same time. How can you simulate this? Can you create this scenario in 3D?

0 Likes