question

mary avatar image
0 Likes"
mary asked Jeanette F commented

Part label name

Hello, I have a model where in source I am creating 1 part example 'A'. For 'A' I am assigning quantity as 4 for this 4 part I need to create different label as 1 ,2,3,4 how can I do that in source.


FlexSim 20.0.10
sourcelabel
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @mary, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Joerg Vogel commented

In the 3d source you have to (in the general case) create one row for each item if you want to assign different labels to them.

1662633193638.png

If you create the items in a process flow, you can use the "tokenIndex" parameter to first assign the label to the token and then copy it to the created item later.

1662633310716.png

If the quantity is the same for each row of the arrival schedule you could assign the label as a function of the source's output statistic.

1662633394850.png

Or you can use custom code and labels to keep track of the number of created items and reset it every time the row in the schedule changes (the row is available as a parameter in the OnCreation trigger).

1662633668945.png


1662633193638.png (8.2 KiB)
1662633310716.png (22.6 KiB)
1662633394850.png (20.9 KiB)
1662633668945.png (52.9 KiB)
· 2
5 |100000

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

mary avatar image mary commented ·
Hi @Felix Möhlmann I want to label as sec1 and sec2 instead of 1 2 3 what can I do. How can I assign string value
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel mary commented ·

convert a number value into a string and concatenate this with another string.

string.fromNum(...)

string ab = "a" + "b";

string flexscript class in manual

https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Basic/string.html



1 Like 1 ·