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
|
|||
|
|||
Automated creation of connections between ports
Hello,
I try to build a model where 400 different products are stored in a rack. These products are than placed on pallets with the help of a combiner satisfying different orders. Every product is send through an individual port to the combiner to assure that the combiner can identify them correctly. Is there some way that I don't have to create the 400 connections from the rack to the combiner manually? I tried to find out how to create nodes for connections in the object tree, but didn't come so long. Or maybe you even have better idea how to model the allocation of the products to pallets/orders, thanks in advance, Matthias |
#2
|
||||
|
||||
Matthias,
The tree is a good place to make connections when you have to make connections from one to many or duplicate one objects connections on many other objects. For what you are doing I would use the script window. The following code will do what you want: treenode fromobj = THE RACK YOU WANT treenode toobj = THE COMBINER int index; for(index = 1; index <= 400; index++) contextdragconnection(fromobj, toobj, "A"); Good Luck, Brandon
__________________
thats not normal. |
The Following 2 Users Say Thank You to Brandon Peterson For This Useful Post: | ||
Matthias Hofmann (06-23-2008) |
#3
|
||||
|
||||
Hello Matthias,
There is a function to connect objects dynamically / automatic: contextdragconnection. But I think there will be an easier way to model your situation. I cannot see exactly what you want to do, but have you thought about using labels instead of the port reference? Anyway your code to connect 1 object to the other 400 times would look something like this (assuming your rack is set as so() and there is already 1 connection): for ( int x = 1; x < 400; x++ ) { contextdragconnection ( so(), outobject ( so(), 1 ), "A" ); } regards, Lolke |
The Following User Says Thank You to Lolke Koopmans For This Useful Post: | ||
Matthias Hofmann (06-23-2008) |
#4
|
|||
|
|||
Hello Lolke,
thanks for the answer. To answer your question, why I model it this way: I try to use as much Flexsim functionality as possible. The combiner uses the input ports for the component list to identify the different products and therefore I need 400 different input ports for the 400 different products. All the products have a label with an unique product number and this is now used to send the products to the correct ports. regards, Matthias |
Thread | Thread Starter | Forum | Replies | Last Post |
improve Connections method | qin tian | Gripes and Goodies | 7 | 03-26-2008 09:42 AM |
Automated runs / Exporting mdb file.. | Nico Zahn | Q&A | 14 | 12-17-2007 11:26 AM |
Flickering yellow line during drag connections in Vista | Dr. Eamonn Lavery | Q&A | 0 | 11-09-2007 10:48 PM |