This 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.
This is a command for manipulating tree data. It is automatically installed with the library.
Name: swapnodes
Parameters: (treenode tn1, treenode tn2)
Descriptrion: Swaps tn1 and tn2 in the tree. Children of tn1 and tn2 are also moved. Locations in memory are unchanged (a global variable set to point to tn1 will stay pointing to tn1, same with tn2)
Example: swapnodes(last(model()),prev(last(model())));