ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
executing automaticly writte flexscript code
Hi,
I got a problem with executing automaticly written flexscript code. I set up a command that created a production line by excuting the command. The command creates queues and processors and connects them. After creating a queue the command sets its initial inventory by using the onreset and onmessage trigger like this: setvarstr(last(model()),"resettrigger","treenode current = ownerobject(c);\n sendmessage(current,current,Number_Kanban_Cards,5, 0);"); setvarstr(last(model()),"messagetrigger",concat( "treenode current = ownerobject(c);\n", "int numitems = msgparam(1);\n", "int flowitemrank = msgparam(2);\n", "treenode destination = current;\n", "for (int index = 0; index < numitems; index++)\n", "{insertcopy(first(rank(node(\"/Tools/FlowItemBin\",model()),flowitemrank)),destination) ;}" )); The command is correct and the desired code will be written in the resettrigger and messagetrigger of the chosen queue. But the desired code won't be executed (althought it is already in the trigger-script window) until I manually go into the code window of the resettrigger and messagetrigger and click on the OK button. Then a window pops up and says it will be added a custom code. Not till then the desired code (to create flowitems on reset) will be executed. Thanks a lot! |
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Name of Operator Executing a task | mutyisi | Q&A | 3 | 11-08-2010 07:17 AM |
is it possible to execute "Multiple Table Import" automaticly at the start of run? | zhang xin | Q&A | 3 | 10-15-2009 09:54 AM |
Is it possible that you can have only 100 local variables in your code? | Tom David | Gripes and Goodies | 3 | 11-06-2008 01:42 PM |
Code autocompletion is great! Would like more shortcuts. | AlanZhang | Gripes and Goodies | 2 | 02-20-2008 10:04 PM |
Model Startup Code | Lolke Koopmans | Q&A | 4 | 12-14-2007 09:51 AM |