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.
Table Commands : All,
Here is a userlibrary that will automatically load the commands listed below. All of the commands are commented as usual and all of the commands have error checking that will display the error message in the output console. Each of the commands is also capable of accepting a treenode, number, or string for the table value.
Commands:
addtablerow
deletetablerow
movetablerow
swaptablerows
resetrowtitles
addtablecol
deletetablecol
movetablecol
swaptablecol
resetcoltitles
Good Luck,
Brandon (6.9 KB)
08-18-2008
2221
1
swapnodes : 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())));
treenode tn1=parnode(1);
treenode tn2=parnode(2);
int rank1=getrank(tn1);
int rank2=getrank(tn2);
if(up(tn1)==up(tn2)){
if(rank1>rank2){
setrank(tn1,rank2);
setrank(tn2,rank1);
}
else{
setrank(t ... [more] (814 Bytes)
07-08-2008
2001
0
select group command : 2 commands (select_group + unselect_group) inside a userlib as a dragable icon.
Execute this commands from the script window to un/select a group of objects. (Don´t use the ; in the script window!):)
Usefull when you have a lot of similar objects you want to change at once.
(E.g. a Visual Tool as an container for a set of processes, which I use to build complex objects for the user lib)
Un/Selects all objects beginning with the given string, on the given level.
Modeltree =0 , inside a VisualTool 1. (2.7 KB)
01-19-2008
2068
0
CreateAndConnect Command : This is a custom User Command made available to you in a user library. The command can be used to automatically create instances of a library class object, position them in your model and connect their input and output ports to a specified object in your model. This is especially useful for creating a variable number of operators during an experiment and connecting them to a dispatcher.
Unzip contents of downloaded file into the libraries directory. Load library through the File menu of the Flexsim Library window.
Name:
CreateAndConnect
Parameters:
(int numobjs, treenode classobj, treenode fromobj, treenode toobj, double xoff ... [more] (1.7 KB)