The tree window helps you browse for a node in the tree. The purpose of selecting a node is dependent on the context of the situation. Sometimes you will use this window to select a start node for a find/replace operation. Sometimes you will use this window to select an experiment variable in the Experimenter. You may also select objects or nodes in the Global Variables window. Select the node you want by clicking on it in the tree view, then click on the Select button. The window will then close and return to the original calling window.
FlexSim is completely designed around the concept of a tree structure. All information in FlexSim is contained within the FlexSim tree, including the library objects, commands, and all model information. This tree hierarchy is made of individual nodes that link together and hold information.
A node is the building block of a FlexSim tree. All nodes have a text containing the name of the node. Nodes can simply be a container for other nodes, can be a keyword used to define an attribute of an object, or may have a data item.
The data item types which may be attached to a node are: number, string, object, or pointer. To attach data to a node, right-click on the node and go to the Insert menu option. You will see the four options to add data to a node. There are also shortcut keys for adding number, string(text), object, or pointer data. These are the keys N, T, O, and P. To add data to a node using a shortcut key, click on the node, then press the appropriate key. Nodes can also hold executable code. To make a node executable, first add string data to the node, and then toggle the node as either a C++ or a FlexScript node. To toggle a node as one of these types, right-click on the node and go to the Build menu.
The symbols for the different types of nodes are shown here:
|Function (FlexScript, not built)|
|DLL Linked Function|
|Global C++ Function|
Nodes can be added and deleted from the tree. To delete a node, simply click the node and then hit the delete key. To insert a node, right-click on an existing node and choose Edit > Insert. This will add a new node immediately after the node that was clicked on. The shortcut for this operation is to hit the spacebar after first highlighting a node.
Nodes can also contain a sub list of nodes called the content branch. If a node contains sub nodes it can be expanded by pressing the button. To insert a node into the content of an existing node, choose the option Edit, then Insert Into (or hit the Enter key as a shortcut).
A node that has object data may contain a second sub list of nodes that are contained in a separate branch of the tree. This sub list of nodes is called the object attribute tree, and contains data that describes the properties of the object. A node containing object data may typically be referred to as an object node. When you click on an object node you will see a greater than symbol to the left of the node. Clicking on this button will open the object attribute tree branch.
The following picture shows an expanded object attribute tree for the Queue object in the library tree.
For nodes with object data, the attribute tree can contain many special attribute nodes. If a node is inside an object and has the name of a key attribute, it will have a special meaning to the object. The actual meaning of the attribute depends on what the attribute is and the object type. As an example, there are attributes for an object's position: 'spatialx', 'spatialy', 'spatialz'. The list of available attributes in FlexSim is found in attribute hints.
In addition to containing all model, library, and project information, the FlexSim tree also stores all windowing and interface information. All open windows, menus, toolbars and buttons have a corresponding representation in the FlexSim tree. We call these types of nodes view objects.
FlexSim's root tree structure is split up into two parts. These are the Main Tree and the View Tree.
The main tree contains the Executive data, the Library, and the Model.
The view tree contains information on windows, editors, and other user interfaces. It also manages active windows.
To view the main tree, click the Tree button on the main toolbar. A new tree window will appear. In Quick Properties you'll see a Tree Navigation section. Click on Main.
The main tree holds many of the higher level functions in FlexSim. It also includes the following crucial sub trees: exec, library, model, undo, media.
To view the view tree, click the Tree button on the main toolbar. A new tree window will appear. In the Quick Properties window you'll see a Tree Navigation section. Click View.
The view tree contains data for creating, storing, and using graphical user interfaces for objects.
The following table explains the keyboard shortcuts available in the tree:
|Spacebar||Insert a new node after.|
|Enter||Insert a new node into.|
|N||Add number data to the highlighted node.|
|T||Add string (text) data to the highlighted node.|
|O||Add object data to the highlighted node.|
|P||Add pointer data to the highlighted node.|
|Shift + Delete||Delete all data from the highlighted node.|
|Backspace and Delete||Delete the node.|
The Search allows you to search through text and node names in the tree. The Search will begin at the highlighted node in the active tree window. If no node is highlighted, the search will begin at the top of the active tree window. The search recursively searches through all subnodes and object attribute nodes.
Replace allows you to replace all occurrences of the found text. This can be applied to text and/or node names.
Finds the specified text (or press the Enter key in the field).
Finds the above text and replaces it with the specified text (or press the Enter key in the field).
Searches through all text under the selected node.
If checked, only finds whole word matches of the text (meaning characters immediately before and after the search text must be non-alphabetic characters).
Searches through all node names under the selected node.
If unchecked, the search will return any node name that contains the searched text.
If unchecked, the search will find all text/names containing the search text, regardless of capitalization. For example, if you search for "myvariablename", the results will still return all nodes containing "MyVariableName".
Once a search is begun, the Find Results window will appear:
Double-click on a result to view the text in a Code Editor window. You may also right click the result to Edit Code or explore the tree.
Nodes toggled as FlexScript will have an S to the left of the node path. Nodes toggled as C++ will display a C and nodes toggled as DLL linked will display a D.
When a node is highlighted in the tree, the Node Properties panel will appear, displaying rank of the node.
This specifies the rank of the highlighted node in its parent's tree. Enter a new rank number or use the up and down arrows to rerank the node.
If the node has coupling data, the Data field will display the coupling's associated node. Use the Sampler button to select the node to create a coupling with.
Destroys all subnodes of the highlighted node.
Calls nodefunction or executefsnode on the node, executing its associated FlexScript, C++ or DLL code.