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
|
|||
|
|||
Named Connections
Having one object refer to another is usually done through (multiple) centerport connections. This requires you to know the port numbers you want (defines make this easier) and if you delete and replace objects you'll likely need to go back through and re-rank the ports.
Attached is a library and example model that uses a simple command to retrieve the object you want WITHOUT using port connections: getconnected(current,"MyConnectionName") There are commands to add connections too, and a GUI to manage them for the whole model (in the example model it's mapped to the Model Control GUI). The Named Connections page of that GUI can be added to the list of pages on an objects GUI/Properties tabcontrol. Two types of connection are made: 1) A bidirectional link (coupling) that is destroyed when either of the two connected objects are destroyed. This link can have different connection names at each end, so the same link could be called 'child' on one and 'parent' on the other, Customer/Supplier, etc... 2) A single direction pointer to the other object. If that object is then destroyed, the pointer's value will be NULL. In the example the names are UnLoadPosition, LoadPosition, UnloadingOperator, RepositioningTransporter, FRsToMove, FRsToUnload, FRsUsingForReference I've not put it to extensive use yet, so any feedback/testing is welcome. Thanks and happy holidays! Last edited by Jason Lightfoot; 02-14-2012 at 02:03 PM. |
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Lars-Olof Leven (12-22-2010) |
Thread | Thread Starter | Forum | Replies | Last Post |
Global variable named "i" | Bill Chan | Gripes and Goodies | 1 | 04-21-2009 06:40 AM |
Automated creation of connections between ports | Matthias Hofmann | Q&A | 3 | 06-25-2008 03:04 AM |
improve Connections method | qin tian | Gripes and Goodies | 7 | 03-26-2008 09:42 AM |
Flickering yellow line during drag connections in Vista | Dr. Eamonn Lavery | Q&A | 0 | 11-09-2007 10:48 PM |