Contents - Index


Adding and Moving Text in the Diagram Window

 

         

 

Use the Add Text button in the toolbar to add a text item to the Diagram window.  A dialog window will appear with radio buttons for Text, Input variable, and Output variable.  The Professional version also offers the option of adding Formatted text.  Clicking the Text radio button will provide an edit box in which the text can be entered, as shown in the first figure above.  The text will initially appear in a default position within the Diagram window (or child Diagram window) when the dialog is dismissed.  It can then be dragged to a new position by pressing and holding the left mouse button down while sliding the text to the desired location.  Alternatively, the text can be moved using the arrow keys, which allow fine control of position.  Holding an arrow key down for three or more seconds will cause the speed of movement to increase.  The text or any of its characteristics can later be changed while in development mode by double-clicking the left mouse button (or by clicking the right mouse button) while the cursor is positioned over the text.  

 

There are 6 buttons (shown at the top of the leftmost figure above) that can be used to add special features to text.  The X_y and X|y will cause the selected text in the Text edit box to be a subscript or superscript, respectlvely. The button will place a line break.  Using this button, it is possible to create a multiline text item.  The position of the line break is placed with a \m in the Text edit box.  The other three boxes will introduce a special character or modifiy the selected character with an overbar, dot or other options.

 

Clicking the New button will place the text item on the Diagram window and allow specifications to be entered for the next text item.  In this way, many text items can be placed on the Diagram window in this one dialog session.  When editing an existing text item, the New button becomes the Delete button.  Clicking the Delete button will delete the selected text time.

 

The Input and Output variable options function in a similar manner, except that the text that appears on the Diagram window is the value of an EES variable.  The EES variable is selected from an alphabetical list of currently defined variables in the main block of equations residing in the  Equations window. The variable name and the units may (optionally) be displayed with the variable value.  The Professional version provides a small button to the right of the Hide array variables checkbox (seen in the above second figure),  Clicking this button brings up the Modify Variable Informaiton dialog that allows the units and display format of the selected variable to be viewed or changed.  It is possible to programmatically change a text specification in the Diagram window from an Output to an Input or vice verse using the capabilities provided in Drop-Down lists.

 

Two input options are available for entering information into string variables.  A string variable is identified with a $ as the last character in its name and it contains string information, rather than a numerical value.  String variables do not have associated units. When a string variable is selected for input, the option of including the units is replaced with an option for providing a list of alternative choices for the string variable.  An Edit button will appear that will allow the existing choices to be viewed and/or changed, as seen in the third figure above. The string choices are displayed in a drop-down list box that displays the available choices when the user clicks in the box.  The drop-down list can be dragged to any location in the Diagram window while in development mode.  An additional capability is that the strings in the drop-down list can be used to set the values of one or more EES variables. When using a drop-down list, it is often convenient to select "New String Variable" from the Input Variable list box.  Doing so will create a new string variable that can be used to control the values of other EES variables.

 

An Input Variable will be displayed with the value enclosed in an editable rectangle or as a drop-down list for strings.  The edit rectangle remains visible when editing is complete if the Frame Text option is selected.  Input variables provide the same function as an equation in the Equations window that sets the variable to a value.  When either the Solve or Min/Max commands are issued, EES will first examine the Diagram window (if it is visible on the screen) to see which variables, if any, are set.  Calculations can also be initiated directly from the Diagram window with an optional Calculate button.  A value that is set in the open Diagram window cannot also be set in the Equations window.  After the calculations are completed, the newly-calculated values of the Output variables will be displayed on the Diagram window.  If the Diagram window is foremost when the Solve command is issued, it will be updated with the calculated output values and remain foremost.  The Solution window will not be displayed.  However, it can be viewed by selecting Solution from the Windows menu.  (The $ShowWindow directive can optionally be supplied to allow any output window to be moved to the front after calculations are completed.)

 

The Professional version  provides an option to enter input values with slider controls.  Click on the slider controls link for more information.

 

The Professional version provides an option to enter the name of a file into a string variable using the standard open file dialog.  

 

The Professional version of EES will provide a field to enter the name of the text item as shown in the dialogs at the top of this screen.  Assigning a name to a text item is useful only when the item is to have its attributes determined by the value of EES variables, such as for animation.  If a name is provided, EES will create variables and associate them with this text object.  For example, if the name of the text item is Refrigerant as shown in the third figure above for string variable R$, the following EES variables will be created (if they do not already exist) after pressing the OK button:

     Refrigerant.left

     Refrigerant.top

     Refrigerant.color

     Refrigerant.hide

     Refrigerant.text$

 

Note the text can be specified dynamically with the EES string variable Refrigerant.Text$.  The names of the text attributes that are can be specified with EES variable names are underlined in the dialog when a name is provided.  The created variables can optionally be assigned values in the EES program.   For example, the position of the Refrigerant text item can be specified by placing the following equations in the Equations window.  

     Refrigerant.left = 100     {­horizontal position is 100 pixels from the left of window;  screen resolution is 96 or 120 pixels per inch}

     Refrigerant.top = 50       {­vertical position is 50 pixels from the top of the window}

     Refrigerant.show          {ensure that it is visible}

 

Note that if an array variable is used for the name, e.g., Text[1], EES will move the array index to the end of the variable name thereby creating variables

     Text.left[1]

     Text.top[1]

     Text.color[1]

     Text.Hide[1]

     Text.Text$[1]

 

To hide or show a text item named Text[1], you could enter Text.Hide[1]=True# or Text.Hide[1]=False#.  A simpler alternative that is accepted is to enter Text[1].Hide or Text[1].Show.

 

The height and width of the Diagram window are provided by the DiagramHeight# and DiagramWidth# functions.  The position of a text item can be converted to inches using the PixelsperInch# function. The text can be hidden in Application mode mode by setting EES variable Name.Hide to a non-zero value where Name is the Name associated with the text item.  Alternatively and more simply, just enter Name.hide or Name.show wherever an EES equation is accepted (e.g., Equations window, Diagram check boxes, etc.) or to hide or show the text item in the Diagram window. 

 

The Parametric Table could also be used to specify values of text attributes.  If the variable associated with a attribute is not used in the EES program, the attribute value is taken to be the value specified in the dialog.  If a value is specified with an EES variable, the EES variable value will override the value in the dialog when the Diagram window is in Application mode.  The value specified in the dialog will be used in Development mode.  

 

To unassociate the EES variable with an text attribute, clear the name field in the dialog and press OK.