Академический Документы
Профессиональный Документы
Культура Документы
• Plotting Window
• After setting the client type you can access the plotting client and get full
access to its functionality using the GetClientHandle command
page1 GetWindowHandle win1 1
win1 GetClientHandle plot1
• Define the datatype, request, and component for the x and y vector
• You can use these two commands together to add the empty curve to a
session:
set curve_index [plot1 AddCurve]
plot1 GetCurveHandle curve1 $curve_index
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• Next we need to set the type of vectors to file using the SetType
command on the vector handle
• SetType can be set to file, math, or values
• Need to define the data type, request, and component, just like we do in
the Build Plots panel within HyperGraph.
• Final step is to tell the window to calculate the curve and draw it
• The Autoscale command forces the plot to recompute the minimum and
maximum values for its axes
• May be necessary to call Recalculate first for recent data changes to be
considered
• The Draw command actually draws the plot with the curves on the window
• Changes made by other methods may not be displayed properly until Draw is
called
• A common practice is to make multiple changes and then call Draw only once,
limiting the number of redraws
plot1 Recalculate
plot1 Autoscale
plot1 Draw
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• Once you have the curve and vector handles, the SetType command
can be set to math
xvector1 SetType math
yvector1 SetType math
• Now that we have adding a note and have the note handle, we can set
the name of the note and add text to the node
• Adding text is done with the SetText command on the note handle
note1 SetName “My Note”
note1 SetText “This is my note”
• If you wish to find the name or text of a note, you can use the GetName
and GetText commands on the note handle
note1 GetName
returns: My Note
note1 GetText
returns: This is my note
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• If curve is selected, we also have to set which curve the note is attached
to using the SetAttachToCurveIndex command on the note handle
• Below is an example where we are attaching to a curve with index of 2
note1 SetAttachToCurveIndex 2
• We also need to supply the index of the point that the note is attached to
using the SetAttachToPointIndex command on the note handle
• Setting the Point Index to 0 attaches the note at the first point of the curve
note1 SetAttachToPointIndex 0
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
• What is Templex?
• Templex is a general purpose text and numeric processor
• Can be used to create fully annotated notes and labels capable of performing
data analysis and curve statistics within a plot window
• For example, let’s report the maximum value of a curve inside a note:
Exercise 6.1
Exercise 6a
Description:
Load in the data file demo.dat and create a curve using the following YType, Y Request, and Y
Component vs Time:
Y Type:Force
Y Request: REQ/13 Curve 13
Y Component: Z
Then in the same window, create a second curve using the following vs. Time:
Y Type:Force
Y Request: REQ/18 Curve 18
Y Component: Z
Update the X axis so that the label is “Time (seconds)” and the Y axis label is “Force (Newtons)”.
Handles used
session, project, page, window, client, curve, vector
TCL/TK commands used
AddCurve, SetFilename, SetType, SetDataType, SetRequest, SetComponent
Hints
Try loading the demo.dat file into HyperGraph to see how the Y Type, Y Request, or Y
Component are defined.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.
Exercise 6b
Description:
Using the 2 curves created in Exercise 5a, add those two curves together.
Update the title of the curve to be “Sum Fz Request 13 and 18”. Add a
note which reports the minimum of the new curve. Attach the note to the
minimum as well.
Handles used
Hints
To attach a note to the curve at the same point as the minimum, try using
the Templex command indexofmin.