article

Benjamin W2 avatar image
5 Likes"
Benjamin W2 posted Benjamin W2 commented

Showing a Label Text on Flow Item Object

We recently had a customer ask how to draw a flow item label on the flow item object. I thought that this information would be useful to other FlexSim users as well.

  1. In the 3D model, drag and drop a Text visual from the Library.
  2. Select the text in the 3D model, then copy it to the clipboard using Ctl + C
  3. Go to the Toolbox tab, open the FlowItem Bin, and double click the Flow Item of interest.
  4. Right click the 3D flow object, and click "Explore Tree"
  5. Click in the white space underneath the Flow Item's node, and use Ctl + V to paste the text as a subnode to the flow item.
  6. If you zoom out in the Flow Item's 3D view, you will see the text. You can double click on the text and use the General tab to position it wherever you would like.
  7. Double click the 3D Flow Item. Underneath the Labels tab, select the green plus sign to add your label. In my example, I added a number label called "Type" with a default setting of 0. Click "OK".
  8. Double click the text that you added in step 5 and 6. Underneath the Display tab, click the custom code button next to Text Display. Within the custom code type something like the following:
    /**Custom Code*/
    Object current = ownerobject(c);
    treenode textnode = param(1);
    
    textnode.value = "Type: " + string.fromNum(current.up.Type);
    //Note: If your label is called something other than "Type", make sure to replace it in both places.
  9. Click out of the "FlowItem Bin" tab and back into the "Model" tab. Double click the source where your Flow Item is being created. Underneath the Triggers tab, add an On Creation trigger.
    1. Click the green plus next to the On Creation trigger. Hover over Data and select "Set Label".
    2. Make sure the text next to the Label field matches the text of the label you set in step 7 and 8.

By following these steps, each Flow Item will have a text label that displays the Flow Item label next to the Flow Item object.

Please see the attached gif for a demonstration.

flowitem-label.gif

labelsflowitemstext
flowitem-label.gif (6.2 MiB)
· 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.

Benjamin W2 avatar image Benjamin W2 commented ·

Hi @Sung Kim.

I believe you will find this article useful.

1 Like 1 ·

Article

Contributors

benjamin.w2 contributed to this article

Related Articles