question

Candan avatar image
0 Likes"
Candan asked Candan commented

Operator and TEXT tag

Customize a TEXT tag

Attached to Operator


How to Operator moves in all directions, TEXT label fixed orientation?

FlexSim 20.2.3
operatertext
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 Candan commented

You can use the 'On Pre Draw' trigger of the operator to adjust the text's position for every frame, so it always appears in the same position/orientation relative to the operator's center point.

In the attached model are two examples: For operator1, the text is a subnode of the operator, for operator2 it is not. The needed code is easier for the second option, since all that is needed is to adjust the location based on a fixed offset to the operator. In the first case, the operator's rotation has to be compensated.

TextTag.fsm


texttag.fsm (44.3 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.

Candan avatar image Candan commented ·

How to fix text tag in operator?

And the text tag cannot be moved?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Candan commented ·

What exactly do you mean with "fit text tag in operator"? You can change the size of the text in its properties.

1656311363301.png

The On Pre Draw trigger in the model moves the tag to a fixed position relative to the operator before every frame is drawn, so any position change you attempt is immediately overwritten.

To adjust the location it is moved to you have to change the parameters in the setLocation command. Currently the location is determined as the center point of the operator plus a fixed offset.

1656311255448.png

(This is the code for Operator2, Operator1 is similar, but the offset is determined based on the operator's rotation)

0 Likes 0 ·
1656311255448.png (14.4 KiB)
1656311363301.png (4.8 KiB)
Candan avatar image Candan Felix Möhlmann commented ·

Thanks

0 Likes 0 ·