question

Muster M avatar image
0 Likes"
Muster M asked Ryan Clark 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...

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

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

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.

Hi @muster.m, was Felix Möhlmann's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. 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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

To create a flowitem you should use

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 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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