question

Patrick Cloutier avatar image
0 Likes"
Patrick Cloutier asked Patrick Cloutier commented

createinstance gives me error I can't fix

I have a flowitem called Cart.

If I try to create copies with this statement I get an error I can't figure after trying to write it 50 ways.

  1. createinstance(library().find("?Cart"),Model.find("Queue1"));

See attached sample model.

ErrorWithCreateInstance.fsm

FlexSim 21.2.2
createinstance
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Patrick Cloutier commented

First of all, especially since you're already using Process Flow, you should just use the Create Object activity to create the cart flowitem.

createCartFlowitem.fsm

The issue with your code is that flowitems are not stored in the library, they are in the flowitem bin. To create a copy of a flowitem defined in the flowitem bin you'd do:

  1. createcopy(Model.find("Tools/FlowItemBin/Cart/1"), Model.find("Queue1"));

· 3
5 |100000

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