question

Alixe avatar image
0 Likes"
Alixe asked Felix Möhlmann commented

How to create multiple objects at once?

Hello,


I am trying to simulate a supply chain. There are multiple processing (20) and demand (39) locations. The processing locations all have the same set of objects and relationships.

Source --> Queue 1 --> Processor 1 --> Queue 2 --> Processor 2 --> Queue 3 --> Processor 3 --> Queue 4 --> Processor 4 --> Queue 5 --> Sink (= Demand Location)

I have created 1 processing location, but would like to replicate this 'mini model' to all the other processing locations. Is there a way for me to edit Flexscript code such that I can iteratively create these objects / relationships?


I also need to connect these processing locations. This would involve having all Queue is connect to all Processor is and all Queue 5s connect to all the Sinks.


Please let me know if there any manageable way to do this without manually repeating the work. Thank you!

FlexSim 25.0.4
flexscript
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 Felix Möhlmann commented

You could put the processing lines into a container object. This allows you to copy the entire line as if it was a single object. If you put it into a group, you can then also use the "Copy And Delete Group Members" option when referencing the group in a parameter.

While it's possible to also create the connections between all objects, this would result in a lot of visual clutter if you have 20 queues with 39 connections each. I would suggest to instead use a list. All queues push to the same list and all demand locations pull from the same list. The "Pull Requirement" field of the pulling objects can then be used to filter what items they can receive.

container-example.fsm


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

Logan Gold avatar image Logan Gold ♦♦ commented ·

You can find a good example of setting up and using a list in one of the Process Flow tutorials - Tutorial 1 - Using Shared Assets.

This doesn't do everything you are asking for, but it should help get you started. Also, the tutorial uses Process Flow with the lists, but you can do something similar in just the 3D objects if desired.

1 Like 1 ·
Alixe avatar image Alixe commented ·

Can you please provide an example of using a list where each queue is linked to all the processors, and then the final processors are linked to all the demand sinks?

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

That is already the case in the model I uploaded. The queues that receive items from the sources and the queues and the end of the lines all push to the same list respectively. And all processors and the sink pull from those lists.

I added a second sink to the model and made each pull items of three specific types only to better demonstrate this.

container-example-2.fsm

0 Likes 0 ·