question

Rania A avatar image
0 Likes"
Rania A asked Rania A commented

CREATE OBJECTS IN DIFFERENT LOCATIONS

Hello everyone,

I am trying to create objects in different slots.
I use the Create Object object in my process flow, but I cant find a way to send the objects in diferent positions.

Is there any way to achieve this ?

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Rania A, wasFelix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom . 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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Rania A commented

Create the object somewhere else first. Then assign the slot to the object. Then move the object into the storage object the assigned slot belongs to. It's functionally the same as if the object was created in the slot if there is no delay.

Assigning the slot and getting the corresponding storage object is already demontrated in your previous question.

· 9
5 |100000

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

Rania A avatar image Rania A commented ·
I can create the objects through a source in my 3D model, however how I can assign for each object created the slot. For one object is okay, I am getting confused when it comes to multiple objects.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Rania A commented ·

WIth "create the object somewhere else" I meant to place the item in another object (or the model itself).

capture1.png

Afterwards you assign the slot and move the object into the storage object.

1696859615700.png

0 Likes 0 ·
capture1.png (3.4 KiB)
1696859615700.png (3.7 KiB)
Rania A avatar image Rania A Felix Möhlmann commented ·
/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
Object item = param(4);
Array flowitems = param(4);
treenode processFlow = ownerobject(activity);


int sourceLabel = gettablenum("Task", 1, 2);
treenode destinationStation;
if (sourceLabel >= 4) {
    // Find the slot with the matching label
    Storage.Slot slot = Storage.system.findSlot("WHERE Position == "+sourceLabel,0,token);
    Storage.Item storageItem = Storage.Item(token.item);
    storageItem.assignedSlot = slot;
    destinationStation = slot.storageObject;
}
return destinationStation;

In the move object i scripted it like that. It works fine if only one item is created. However, I dont know how I can send the second item to another position. I select my positions based on values from my global table "Task"

0 Likes 0 ·
Show more comments