question

Sebastien avatar image
1 Like"
Sebastien asked Jason Lightfoot commented

Create item on middle of conveyor via FlexScript

Hi !

I would like to create a flowitem via Flexscript in a ProcessFlow and place the item on a defined position on a conveyor.

So far I could create the item, define its parents (the conveyor) and its position, but when I run the model the item does not go further on the conveyor. When I try this with a processor instead of a conveyor it works.

Am I missing a step ?

Here is the code I used:

  1. newToken = createtoken(processFlow, activityName, 1);
  2. newItem = createcopy(Model.find("/Tools/FlowItemBin/Box/1"), model().find(ConveyorName));
  3. newItem.setLocation(Vec3(positionX, positionY, positionZ), Vec3(0.5, 0.5, 0));
  4. setlabel(newToken, "item", newItem);


FlexSim 20.2.3
conveyorflexscriptflowitem
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
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

You can put an entry transfer at the desired position along the conveyor and have the item enter through that.

You can also extend a single entry transfer along the length of a conveyor and set the location.x property of the item before moving it to the transfer to say at what point it should enter the conveyor (see attached model)

createItemsAlongConveyor.fsm

Lastly the legacy basic conveyor lets you add items at any position along it.


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