question

CHRISTIAN B3 avatar image
0 Likes"
CHRISTIAN B3 asked CHRISTIAN B3 commented

How to change a 3D text´s "Text Display" from an external code or process flow

I need to change the text of a 3D text display not from the text code editor (cause I think is not viable), but rather from an external code, like process flow. In the model attached I used a code in a trigger. When a box arrives at the decision point, the trigger code wants to change the text. I tried in 2 ways:

1) with the deprecated command setnodestr(node, text) with no result, and

2) with texttreenote.value = newtext, in this case the 3D text moves somewhere else in the model, and cannot find it anymore....

I think the text code editor is not a viable option, cause the texts I need to show are stored inside a global table (eg: process statuses and stock values that I cannot reference with the predefined options), and the moment of the text update is triggered by tokens...

FlexSim 24.0.1
visual textdynamic text
5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered CHRISTIAN B3 commented

The easiest option would be to set the text to display the value of a label and change the label.

changetextdisplay_1.fsm

In your code "textnode" is a pointer to the text object. By setting its value you overwrite the object data with a string, essentially deleting the object.


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

CHRISTIAN B3 avatar image CHRISTIAN B3 commented ·
Thanks for the answer, it accomplishes the objective I have that is to change the text from an external code. I was looking for a command like: treenode.command, and yours is treenode.label... that is fine as well. Thanks again.
0 Likes 0 ·
Sri_vikas K avatar image
0 Likes"
Sri_vikas K answered CHRISTIAN B3 commented

Hi @CHRISTIAN B3

In my recent projects, I executed this logic in the same way that @Felix Möhlmann is suggesting now, by creating a label for the 'Text' and accessing its value at Display Text.



"I am attaching the model. Here’s what I did:

  1. Created a label for the Text and added custom code in the DisplayText (in text Properties) column to access its value.

  2. Upon arrival trigger, I set the value to change the 'Old Text' to 'New Text'.

  3. On model reset trigger, I am rechanging the label value to 'Old Text'


Text Change_SVK.fsm


text-change.mp4 (6.5 MiB)
text-change-svk.fsm (40.4 KiB)
· 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.

CHRISTIAN B3 avatar image CHRISTIAN B3 commented ·
Thanks, I needed to reset the value at reset. You helped me !
0 Likes 0 ·