Contents - Index


Adding lines, arrows, boxes and circles

 

Graphic objects such as lines (or arrows), boxes, circles, polylines, bezier curves and polygons can be placed on the Diagram window or Child diagram window using the buttons in the Diagram window toolbar.  The Diagram window must be in Development mode in order to access the toolbar.   The operation of all of these tools is similar.  Click on the appropriate button in the toolbar.  The button will then appear in a selected or "down' state.  Then move the mouse to the upper left corner of the item and press and hold the left mouse button down while dragging the mouse to the lower right corner.  Release the button and the graphic item will appear in the Diagram window.  

 

Any graphic item placed on the Diagram windows can be edited in Development mode by right-clicking on the item and selecting the Properties item from the popup menu. 

 

Normally, selected graphic objects can be moved with the arrow keys or with the mouse if the Diagram window is in Development mode.   However, if the Locked checkbox is selected, the graphic object can not be moved.  This feature prevents accidental movement of an object.  Note that the graphic object is moved to the specified position in Application mode.  The Locked attribute has no effect in Application Mode.  Note that, when using the arrow keys to move selected items, the speed at which they move will vary between 1 and 5 pixels.  When you first press an arrow key, the items will move 5 pixels.  If you release the key and press it again, the items will move one pixel.   

 

If the Transparent checkbox is selected, the graphic object will be display in a way that allows objects below it to be seen.  The transparent color is assumed to be white, which is the background color of the Diagram window.

 

The Professional version allows a Name to be optionally assigned to each graphic object as shown below for a circle/ellipse object

 

 

Assigning a name to a graphic item is useful only when the item is to have its attributes determined by the value of EES variables, such as for animationIf a name is provided,  EES will create variables and associate them with this object.  For example, in the example below, the following EES variables will be created (if they do not already exist) after pressing the OK button in the dialog that creates the red circle.

Ball.left         Ball. top

Ball.width  Ball.height

Ball.angle        Ball.Hide

Ball.fillColor Ball.lineColor

Ball.linetype Ball.filltype

 

Note that the names of the attributes that can be specified with EES variable names are underlined.  The created variables can optionally be assigned values in the EES program.   For example, the position of the ball can be specified by placing the following equations in the Equations window.  

Ball.left = 100    {horizontal position is 100 pixels from the left of window}

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

 

The units for the position specifications are pixels.  The height and width of the Diagram window are provided by the DiagramHeight# and DiagramWidth# functions.  The position can be converted to inches using the PixelsperInch# function. 

 

The angle attribute is specified in degrees (0 to 360).  The object rotates counterclockwise about its center with increasing angle.

 

The Hide attribute is true or false.  False is associated with a value of 0 and true is a non-zero value for the EES variable name.hide.  The true# and false# constants are useful for setting this attribute.  For example, to hide the ball, set Ball.Hide=true#.  An alternative and simpler way to hide or show the object (available in versions 8.298 and newer) is to enter Ball.Hide or Ball.Show.  Objects will always be shown in the Development mode, regardless of the setting of the Hide check box of the value of Name.hide. 

 

The fillColor and lineColor attributes are colors that can be specified using the RGB function.  For example, to set the fill color of the ball to red, enter

 

Ball.fillColor=RGB(255,0,0)

 

A number of common colors have been specified as Constants.  The red color for the ball could have been set with the following statement.

 

Ball.fillColor=red#

 

The linetype attribute is an integer value between 1 and 4.  1=thin line    2=thick line   3=dotted line    4=no line.

 

The filltype attribute is an integer value between 0 and 7, defined as indicated in the following table.

 

 

____________________________________________________________________________________

 

 

The Diagram Line Characteristics dialog shown in the above figure will create these following variables:

Line1.X1 Line1.Y1

Line1.X2 Line1.Y2

Line.Color Line.Hide

Line.LineStyle

 

The Color attribute can be specified with the RGB function or with a color constant.  For example, to set the line color to blue, you enter either of the following two equations:

Line1.color=RGB(0,0,255)      {­RGB is a built-in function}

Line1.color=blue#

 

The Linetype is an integer between 1 and 8.  The line styles are shown in the following table.

 

 

When there are many objects, it may be convenient to use array variables.  For example, the name of the line could be Line[1].  In this case, EES would create the following variables.

Line.X1[1] Line.Y1[1]

Line.X2[1] Line.Y2[1]

Line.Color[1] Line.Hide[1]

 

Note that the array index is moved to the end of the variable name to be consistent with the array name convection in EES.  To hide or show a line that has name Line[1], you could enter Line.Hide[1]=True# or Line.Hide[1]=False#.  A simpler alternative that is accepted is to enter Line[1].Hide or Line[1].Show.

 

The Parametric Table could also be used to specify values of object 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 object attribute, clear the name field in the dialog and press OK.