question

Karan avatar image
0 Likes"
Karan asked Karan commented

Create objects with unique names using process flow

Hi,

Is there a way to create unique names when using the create object activity? All flow items that are created have the same name "Pallet" or "Cylinder".

Thanks!

FlexSim 22.2.0
uniquecreate object activityflow item name
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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Karan commented

Use a numeric global variable eg 'numitems' and the set the name with something like:

token.item.name+="_"+numitems++;

itemUniqueNames.fsm


itemuniquenames.fsm (28.6 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.

Karan avatar image Karan commented ·
Thank you @Jason Lightfoot! This worked well.


I had an incremented label called PalletID, so I used that instead of creating a global variable. I am currently referencing the PalletID label in other places but now that I have unique object names I could reference those directly. Once I have that updated I will be move over to using a global variable.

Instead of adding a _1, _2.. I ended up replacing the name itself using
token.item.name = "Pallet"+numitems++

0 Likes 0 ·