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:

newToken = createtoken(processFlow, activityName, 1);
newItem = createcopy(Model.find("/Tools/FlowItemBin/Box/1"), model().find(ConveyorName));
newItem.setLocation(Vec3(positionX, positionY, positionZ), Vec3(0.5, 0.5, 0));
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.

Sebastien avatar image Sebastien commented ·

Thank you @Jason Lightfoot for your answer !

I'll try to implement the legacy basic conveyor as it would also help with bidirectionnal conveying. Is there some kind of tutorials for that ? I just did some quick searches and could not find any.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Sebastien commented ·
If you can avoid using the legacy conveyor then do so because it's no longer supported. I can think of some cases where acceleration/ speed might need to be set per item so in those cases I think the basic conveyor is still applicable. I don't think there are tutorials but the commands are listed in the online help.
0 Likes 0 ·