question

Adyasha K2 avatar image
1 Like"
Adyasha K2 asked Adyasha K2 commented

Multiplying Model Output with a number

Hello Team, In one flexsim model output is shown in text "Object Stat:". I want to multiply model output with 10 & to display it in another text. Please help me out.



FlexSim 22.1.3
visual text
· 1
5 |100000

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

Adyasha K2 avatar image Adyasha K2 commented ·

I have uploaded the model in Flexsim's file share sit. File name : Multiplier in Model Output - Final Output

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Adyasha K2 commented

To customize what the text object displays, open the code window of the "Text Display" field with the scroll icon to the right of it.

In line 5 the text that is shown before the value is set. Changing the value in this line is the same as if you changed the text in the Text Display field options.

Starting from line 7, look for the case number belonging to the statistic you are displaying. In the example below the text displays the output, so the case number is three.

Then search for the respective "case" in the switch statement starting in line 23. If the statistic is a number, it is first converted into a string (text) so it can be shown in the text object. This is done with the "string.fromNum()" command. The first parameter in the function is the numeric value that should be converted.

Depending on which statistic is displayed the command/code that reads the respective value will change. In every case you can simply append a multiplication to the command to change the displayed value.

1660897159008.png


1660897159008.png (131.2 KiB)
· 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.

Adyasha K2 avatar image Adyasha K2 commented ·

Please share a conceptual model as well. I am not able to do this

0 Likes 0 ·
Adyasha K2 avatar image Adyasha K2 Felix Möhlmann commented ·
Thank you so much. I am going to apply this now.
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.