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.

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:

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.

Patrick Cloutier avatar image Patrick Cloutier commented ·
Thanks !!

The reason why I do it with code instead of the CreateObject activity is because I use this command to create starting inventory in a large number of queues. I use a for loop to place a cart in all members of a group of queues.

But why can't I use createinstance?

0 Likes 0 ·
Patrick Cloutier avatar image Patrick Cloutier Matthew Gillespie ♦♦ commented ·
I spent at least 30 minutes searching through Answers before I posted this question and I never came across that post from last year on the same subject. Weird.
0 Likes 0 ·

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.