question

Muster M avatar image
0 Likes"
Muster M asked hermione12 commented

Create a flow item object by code

I want to create a flow item object with flexscript in my model, so a operator can pick it up from a set location. I found this code snippet, but it can't find the flow item class I guess...

  1. Object item = createinstance(library().find("Box"),model());

I guess I need something else for "library()" ?

FlexSim 21.2.0
flexscriptflexsim 21.2.0create objectflow itemscreateinstance
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered hermione12 commented

To create a flowitem you should use

  1. Object item = createcopy(Model.find("/Tools/FlowItemBin/<NameOfTheFlowItem>/1"), model());

Alternatively, you could use a message triggered source in process flow together with a "Create Objects" activity, to generate objects by sending a message to a specified object.

· 5
5 |100000

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