Sie sind auf Seite 1von 113

HyperWorks 13.

0
HyperGraph 2D Tutorials

HyperWorks is a division of Altair

altairhyperworks.com

Altair Engineering Support Contact Information


Web site

www.altairhyperworks.com

Location

Telephone

e-mail

Australia

64.9.413.7981

anzsupport@altair.com

Brazil

55.11.3884.0414

br_support@altair.com

Canada

416.447.6463

support@altairengineering.ca

China

86.400.619.6186

support@altair.com.cn

France

33.1.4133.0992

francesupport@altair.com

Germany

49.7031.6208.22

hwsupport@altair.de

India

91.80. 6629.4500
1.800.425.0234 (toll free)

support@india.altair.com

Italy

39.800.905.595

support@altairengineering.it

Japan

81.3.5396.2881

support@altairjp.co.jp

Korea

82.70.4050.9200

support@altair.co.kr

Mexico

55.56.58.68.08

mx-support@altair.com

New Zealand

64.9.413.7981

anzsupport@altair.com

North America

248.614.2425

hwsupport@altair.com

Scandinavia

46.46.460.2828

support@altair.se

United Kingdom

01926.468.600

support@uk.altair.com

In addition, the following countries have resellers for Altair Engineering: Colombia, Czech Republic, Ecuador, Israel, Russia,
Netherlands, Turkey, Poland, Singapore, Vietnam, Indonesia
Official offices with resellers: Canada, China, France, Germany, India, Malaysia, Italy, Japan, Korea, Spain, Taiwan, United
Kingdom, USA
Copyright Altair Engineering Inc. All Rights Reserved for:
HyperMesh 1990-2014; HyperCrash 2001-2014; OptiStruct 1996-2014; RADIOSS1986-2014; HyperView1999-2014;
HyperView Player 2001-2014; HyperStudy 1999-2014; HyperGraph1995-2014; MotionView 1993-2014; MotionSolve 20022014; HyperForm 1998-2014; HyperXtrude 1999-2014; Process Manager 2003-2014; Templex 1990-2014; TextView
1996-2014; MediaView 1999-2014; TableView 2013-2014; BatchMesher 2003-2014; HyperMath 2007-2014;
Manufacturing Solutions 2005-2014; HyperWeld 2009-2014; HyperMold 2009-2014; solidThinking 1993-2014; solidThinking
Inspire 2009-2014; solidThinking Evolve 1993-2014; Durability Director 2009-2014; Suspension Director 2009-2014;
AcuSolve 1997-2014; AcuConsole 2006-2014; SimLab2004-2014 and Virtual Wind Tunnel 2012-2014.
In addition to HyperWorks trademarks noted above, Display Manager, Simulation Manager, Compute Manager, PBS,
PBSWorks, PBS GridWorks, PBS Professional, PBS Analytics, PBS Desktop, PBS Portal, PBS Application Services,
e-BioChem, e-Compute and e-Render are trademarks of ALTAIR ENGINEERING INC.
Altair trademarks are protected under U.S. and international laws and treaties. Copyright 1994-2014. Additionally, Altair software
is protected under patent #6,859,792 and other patents pending. All other marks are the property of their respective owners.
ALTAIR ENGINEERING INC. Proprietary and Confidential. Contains Trade Secret Information. Not for use or disclosure outside of
ALTAIR and its licensed clients. Information contained inHyperWorks shall not be decompiled, disassembled, or unlocked,
reverse translated, reverse engineered, or publicly displayed or publicly performed in any manner. Usage of the software is only as
explicitly permitted in the end user software license agreement.
Copyright notice does not imply publication

HyperGraph 2D 13.0 Tutorials


.............................................................................................................................................3
Plotting
Basics
..............................................................................................................................................................................4
HG-1000: Plotting
XY Data
..............................................................................................................................................................................17
HG-1010: Changing
Curve Display Attributes
..............................................................................................................................................................................22
HG-1011: Perform
Math on Curves Using the Plot Browser
..............................................................................................................................................................................30
HG-1020: Modifying
Plots
..............................................................................................................................................................................36
HG-1021: Modifying
Plots with the Plot Browser
..............................................................................................................................................................................52
HG-1030: Referencing
and Filtering Curves
..............................................................................................................................................................................55
HG-1040: AVD
Diagram Using Unit Scaling and Plot Browser

.............................................................................................................................................63
Advanced
Curve Manipulation
..............................................................................................................................................................................64
HG-2000: Evaluating
Curve Data
..............................................................................................................................................................................68
HG-2010: Creating
a Plot Macro

More .............................................................................................................................................75
Plotting
..............................................................................................................................................................................76
HG-3000: Working
with Bar Charts
..............................................................................................................................................................................80
HG-3010: Working
with Complex Plots
..............................................................................................................................................................................85
HG-3020: Working
with Polar Plots

.............................................................................................................................................90
Templates
..............................................................................................................................................................................91
HG-4000: Creating
an Export Template

.............................................................................................................................................97
Customization
..............................................................................................................................................................................98
HG-5010: Customizing
the Environment

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HyperGraph 2D Tutorials
File Location

All files referenced in the HyperGraph tutorials are located in the HyperWorks
installation directory under <install_directory>/tutorials/mv_hv_hg/.

Finding the Installation Directory <install_directory>


Most tutorials use files that are located in the tutorials/ directory of the software installation.
In the tutorials, file paths are referenced as <install_directory>/../. In order to locate the
files needed, you will need to determine the path of the installation directory
<install_directory>. This path is dependent on the installation that was performed at your
site.
To determine what this path is, follow these instructions:
1.

Launch the application.

2.

From the Help menu, select Updates.


The HyperWorks Update Information dialog opens. The installation directory path appears
after Altair Home:.
The HyperGraph tutorial model files are located in <install_directory>/tutorials/
mv_hv_hg.

Plotting Basics
HG-1000: Plotting XY Data
HG-1010: Changing Curve Display Attributes
HG-1011: Perform Math on Curves Using the Plot Browser
HG-1020: Modifying Plots
HG-1021: Modifying Plots with the Plot Browser
HG-1030: Referencing and Filtering Curves
HG-1040: AVD Diagram Using Unit Scaling and Plot Browser

Advanced Curve Manipulation


HG-2000: Evaluating Curve Data
HG-2010: Creating a Plot Macro

More Plotting
HG-3000: Working with Bar Charts
HG-3010: Working with Complex Plots
HG-3020: Working with Polar Plots

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Templates
HG-4000: Creating an Export Template

Customization
HG-5010: Customizing the Environment

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Plotting Basics
HG-1000: Plotting XY Data
HG-1010: Changing Curve Display Attributes
HG-1011: Perform Math on Curves Using the Plot Browser
HG-1020: Modifying Plots
HG-1021: Modifying Plots with the Plot Browser
HG-1030: Referencing and Filtering Curves
HG-1040: AVD Diagram Using Unit Scaling and Plot Browser

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

HG-1000: Plotting XY Data


In this tutorial you will learn how to:
Plot curves from files.
Plot multiples curves in one window.
Plot multiple curves in multiple windows.
Use the Advanced Plot Options dialog to change the curve and plot attributes

Tools
The Build Plots panel can be accessed one of the following ways:
Click the Build Plots icon,
OR
From the menu bar, select Curves > Build Plots.
This panel allows you to construct multiple curves and plots from a single data file. Curves can be
overlaid in a single window or each curve can be assigned to a new window.

The Advanced Options feature on the Build Plots panel allows you to apply many options at
once to the session during plotting. Curves created in this manner are added to the session in a
new layer.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

From the Build Plots panel, click Adv. Options to display the Advance Plot Options dialog.

The Multiple File Plotting dialog allows you to select multiple files with intersecting data (for
example, multiple runs of a particular test) and plot the data from all files simultaneously in the
current HyperGraph session.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

To access the Multiple File Plotting dialog, click the Multiple File Plotting button,
Build Plots panel.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

, on the

Altair Engineering

Exercise: Creating XY Curves from Data Files


Step 1: Open the demo.dat file.
1.

From File menu, select New > Session to clear all contents in the HyperGraph session.

2.

Verify XY Plot is selected from the plot type menu,

3.

Click the Build Plots icon,

4.

Click the Open File button,


, and open the file <installation_directory>/tutorials/
mv_hv_hg/plotting/demo.dat.

Step 2: Build multiple curves on a single plot.


1.

For X type: select Time.

2.

From the Y type: column, select Force.


The data available in the file is listed under the Y Request column.

3.

Under Y Request:, click the expansion button,

4.

Under Y Request:, press and hold the CTRL key and select REQ/3 Curve 3, REQ/5 Curve 5,
REQ/7 Curve 7, and REQ/9 Curve9.

5.

Click OK to close the expanded list dialog.

6.

Under Y Component:, select X.

7.

Click Apply to create the curves on page 1.

Altair Engineering

, to easily view the Y Request list.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

The plots X axis is labeled Time (the X type), while the y axis is labeled Force (the Y type).
The plots title is X (the Y Component name). The curves names are the Y Request names.

Step 3: Build multiple curves on multiple plots.


While in the Build Plots panel, do the following:
1.

Verify X type: Time is selected.

2.

Under Y type:, leave Force selected.

3.

Under Y Request:, leave REQ/3, REQ/5, REQ/7, and REQ/9 selected.

4.

Under Y Component:, press the CTRL key and select Y and Z to add them to the already
selected X.
-OrPress the SHIFT key and select Z. This selects Z and everything between X and Z.
-OrLeft click on X and drag the mouse down to Z.

5.

From the Layout: drop-down menu, select One plot per Request.
This option creates one plot for each selected Y request. Each plot contains as many curves
as there are selected Y components. The plots title is the Y Request name. The curves label
is the Y Component name.

6.

Click the Page Layout button,

, and select the four-window layout from the panel area.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

7.

Click Apply to create the plots and curves on page 2.

Step 4: Use Advanced Options to change the curve and plot display
attributes.
While in the Build Plots panel, do the following:
1.

Keep the curves you created in Step 3.

2.

Click Adv. Options.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

The Advanced Plot Options dialog is displayed.

3.

To change the page title font, click Page Options on the left side of the dialog.

4.

Click in the Font field on the right side of the dialog. Next, click the Font icon,
the Font dialog. Change the font size to 16.

5.

Under Plot Options, select Header.

6.

Click in the Header field on the right side of the dialog to activate the drop-down menu.
Deselect Y-Component.

, to display

This will remove the Y component from the header.


7.

Select Horizontal Axis from the left side of the dialog. Click in the Font field on the right side
of the dialog. Next, click the Font icon,

, to display the Font dialog.

8.

From the Font dialog, change the font size to 12.

9.

Repeat steps 7 and 8 the Vertical Axis.

10. Select Legend from the left side of the dialog.


11. From the Font dialog, change the legend font size to 10.
12. Select Curve Options from the left side of the dialog.
13. Click in the Label field on the right side of the dialog to activate the drop-down menu.
Deselect Y Request.
This removes the Y request from the label
14. Activate Show Prefix.

10

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

15. Click the Label Prefix field. Once the cursor is displayed, enter Test 17.
16. Click OK to exit the Advanced Options dialog.
17. From the Build Plots panel, click Apply.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

11

You can also perform filtering on the curve. For this, retain the curve and plot modifications you
just performed.
18. From the Build Plots panel, select Adv. Options.
19. Click Curve Options on the left side of the dialog.
20. Activate Math Expression.
21. Leave Expression for x as is.
22. Enter the following filter in the Expression for y field: saefilt95(u,v,60,5,3).
23. Click OK.
24. From the Build Plots panel, click Apply.
25. From Define Curves panel,

12

, you will see the filter you applied display in the y vector field:

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 5: Use Multiple File Plotting to plot multiples curves in one plot.
1.

From File menu, select New > Session to clear all contents in the HyperGraph session.

2.

Verify XY Plot is selected from the plot type menu,

3.

Click the Build Plots icon

4.

Next to Data File, click the Multiple File Selection icon,

.
.

The Multiple File Plotting dialog is displayed.


5.

Next to Select directory, click the Open File button,


, and browse to the directory file
<installation_directory>/tutorials/mv_hv_hg/plotting/MultipleFiles.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

13

6.

You can expand the folders in the File Browser List to display the files contained in each
folder.

You can select files from the File Browser List and click the arrow,
Selected File Set. For this tutorial, we will filter them.

, to move them to the

7.

In the File-Filter field, enter *T01 and press ENTER. The following files are displayed:

8.

While holding the CTRL button, select the first eight files listed under File Browser List and
click the right-facing arrow, , to move them to the Selected File Set.

14

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

9.

Under Curve Name, leave Prefix activated and select Directory Level 2 from the drop-down
menu.

10. Under Curve Attributes (Color/Style), leave By File selected.


11. Click Select to exit the dialog.
12. From the Build Plots panel, make the following selections:
- For Y Type:, select Global Variables.
- For Y Request:, select Internal Energy and Kinetic Energy.
- For Y Component:, select MAG.
13. From the Layout: drop-down menu, select One plot per Request.
14. Click the Page Layout button,

, and select the two-window layout from the panel area.

15. Click Apply.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

15

16. You can also view the curve Label Prefix and Label information in the Plot Browser. These
fields were edited using the Advanced Options dialog in Step 4.

16

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HG-1010: Changing Curve Display Attributes


In this tutorial you will learn how to:
Use the Headers/Footers panel
Change curve attributes
Use the Notes panel
Use the Options panel and style sheets

Tools
The Headers/Footers panel can be accessed in one of the following ways:
Click the Headers/Footers panel icon

in the toolbar

Or
From the menu bar select Annotations > Headers/Footers
The Headers/Footers panel allows you to add headers and footers to your plots, specify font
style and color, position the titles, and turn them on and off.

The Curve Attributes panel can be accessed in one of the following ways:
Click the Curve Attributes panel icon

in the toolbar

Or
From the menu bar select Curves > Curve Attributes
This panel allows you to change curve attributes such as line style, color, and weight as well as
symbol style and color.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

17

The Options panel can be accessed in one of the following ways:


Click on the Options panel icon
Or
From the menu bar select Preferences > Options
This panel allows you to change the color of a XY plot windows background, frame, grid lines, and
zero line.

The Notes panel can be accessed one of the following ways:


Click on the Notes panel button,
Or
From the menu bar select Annotations > Notes
This panel allows you to annotate plots. Notes are text boxes placed in plot windows for labeling
points, describing trends, and relating additional curve information. You can create logic and
expression-based notes using Templex.

The Apply Style dialog can be accessed in the following ways:


Right-click in the plot window and select HG ApplyStyle

18

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

The Apply Style dialog allows you to quickly apply a plot windows attributes across all plot
windows on the current page, or on all pages in the plot.

Exercise: Editing Curve Display Attributes


Step 1: Open Session File demo_3.mvw.
1.

From the File menu, click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/demo_3.mvw and


click Open.

Step 2: Change the header for window 1 to REQ/3 force.


1.

Verify that window 1 on Page 2 is active.

2.

Click on the Headers/Footers panel icon,

3.

From the Header tab, replace the name REQ/3 curve 3 with REQ/3 force and press ENTER
to apply the change.

4.

Change the header font size by clicking the font button,

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

19

5.

Change the color of the header from the color palette.

Step 3: Change the line style for the curves in window 1.


1.

Click the Curve Attributes icon

2.

From the Curves list, select X, Y, and Z.

3.

From the Line Attributes tab, change the thickness of the curves.

Step 4: Change the frame color for window 1 to yellow.


1.

Click on the Options panel button,

2.

From the Color tab, select the option Frame.

3.

Select yellow from the color palette.

Step 5: Apply the window and curve display attributes of window 1 to the
other plot windows on page 2.
1.

In window 1, right-click and select HG ApplyStyle from the pop-up menu to open the
Apply Style dialog.

2.

Select Current page.

3.

Activate only the attribute options Plot, Header, and Curves. Deactivate all other options.

4.

Click OK to apply the active attributes to the other plot windows on page 2.

Step 6: Create the note "Max force is {Y} at time {X}" and attach it to a
curve in window 1, on page 2.
1.

Activate window 1.

2.

Enter the Notes panel,

3.

Click Add to create a new note named Note1.

4.

From the Text tab, replace Note1 with Max force is.

5.

Under the Text window box, click {Y} to add the Templex string {y} to the note.

6.

Append to the note at time and click {X}.

The complete note is "Max force is {y} at time {x}".


7.

20

Click Apply to update the note.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

8.

From the Attach to tab, select the option Curve to add the note to a curve.
Note: The note automatically attaches to a data point on curve 1 (the X curve). In the Notes
panel, the Curve and Point to which the note is attached is called out. The notes {X} and
{Y} Templex statements are updated to reflect the data points X and Y values.

9.

Click points on any of the curves in window 1 to update the location/curve to which the note
is attached.
Note: The {X} and {Y} values are updated automatically.

10. Under Find point, click the Maximum button,


maximum Y value.

, to attach the note to the curves

11. With Note1 highlighted in the Notes list, turn off this note by deactivating the Note box.

Step 7: Create and attach a second note with Templex to a curve.


While in the Notes panel, do the following:
1.

Activate window 3.

2.

Add a note.

3.

On the Text tab, replace Note2 with "curve Y absolute area is


{absarea(p2w3c2.x,p2w3c2.Y)}".
The text in curly braces is a Templex statement.

4.

Click Apply to update the note.

5.

On the Attach to tab, select the option Curve.

6.

Click the Next Curve button until the note is attached to curve 2 (curve Y).

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

21

HG-1011: Perform Math on Curves Using the Plot Browser


In this tutorial you will learn how to use the Plot Browser to perform the following tasks:
Perform math on a single curve in the Define Curves panel without creating duplicate
curves
Apply this math to all other curves in the session via the Plot Browser

Tools
The HyperGraph 2D Plot Browser resides on a tab in the Tab Area sidebar and allows you to view
the HyperGraph 2D plot structure.

The Plot Browser can be turned on or off using the View > Browsers > HyperGraph 2D > Plot
menu options. A check mark indicates that the HyperGraph 2D Plot Browser is activated for display
in the Tab Area.
You can use the Plot Browser tools to search, display and edit entities and their properties within
the current session.
From the Define Curves panel, you can edit existing curves and create new ones. To edit a
curve, it must first be selected either from the curve list or picked from the window.

22

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

The X,Y, U, and V vectors are displayed at the top of the Define Curves panel. The data sources
for these vectors are displayed in the text fields. Click the radio button for a vector or click in the
corresponding text box to select that vector for editing. In addition to the traditional X and Y
vectors, you can perform math on curves prior to plotting your data with the support of u and v
vectors. As a result, only one curve is generated in the session, whereas in the older versions of
HyperGraph, this could not be done without an initial curve.
To use math as a data source, from the Define Curves panel, select Source > Math.

Exercise:
Step 1: Open Session File demo_browser.mvw.
1.

From the File menu click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/


demo_browser.mvw and click Open.

Step 2: Use the Define Curves panel to apply an SAE filter to a curve.
1.

From the toolbar, select the Define Curves icon,

2.

Activate the x= radio button.

3.

Under Source, select Math.

4.

In the x= field, enter u. This applies the u vector to the x vector.

5.

Click Apply.

6.

Activate the y= radio button.

7.

Under Source, select Math.

8.

In the y= field, enter v. This applies the v vector attributes to the y vector.

9.

Click Apply.

You can now apply math to the y vector.


10. For the y vector, remove the v vector you entered in step 8.
11. With your cursor in the y= field, click Functions....

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

23

12. From the Functions dialog, select saefilt95 and click OK.

13. The saefilt95 function takes six arguments: vector1, vector2, scalar1, scalar2,
scalar3, scalar4.
14. Enter the following text in the function: saefilt95(u,v,60,20,3) and click Apply.

24

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

15. The result is a corrupt curve. This is because the function expects the time to be in seconds,
and our curve is in milliseconds.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

25

16. To correct this, you must apply the time vector by 0.001. Enter the following in the y= field:
saefilt95(u*0.001,v,60,20,3).
The result is a properly filtered curve:

Step 3: Apply the math performed in Step 2 to all other curves in the
session via the Plot Browser.
In this step, you will apply the filter defined in Step 2 to all curves in the session using the Plot
Browser.
1.

From the Define Curves panel, highlight the y vector filter you added in step 1 and press
CTRL+C to copy it.

2.

From the Plot Browser, select the Curves icon from the top of the browser. This filters the
session information so that only the curve information is displayed in the Plot Browser.

3.

Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and
Curve by clicking the plus button next to each folder.

26

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

4.

As shown below, right-click on the y vector and select Select All.

All y vectors in the session are selected.


5.

Go to the Properties Table at the bottom of the Plot Browser.

6.

From the Source drop-down menu, select Math.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

27

7.

Notice that all the curves in the graphics area disappear, except for the curve we have
already filtered on the Define Curves panel.

8.

Click in the Expression field and paste the filter you copied from the Define Curves panel and
press ENTER.
All curves in the session now contain the same filter and math.

9.

28

It is not required, but you can also apply math to the x vector. Similar to the steps above,
right-click on the x vector from the Plot Browser and select Select All to select all x vectors in
the session.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

10. From the Source drop-down menu, select Math.


11. In the Expression field, enter u.
Now all vectors in the session have the same math.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

29

HG-1020: Modifying Plots


In this tutorial you will learn how to:
Work with the Axes panel
Use the Coordinate Info panel and TextView
Modify curves
Create secondary axis and assign curves to them

Tools
The Axes panel can be accessed one of the following ways:
Click the Axes icon
Or
From the menu bar select Annotations > Axes
This panel allows you to add multiple axes to plots. Also, axis attributes such as labels, color, and
scaling can be modified.

To access Convert Units tool, right-click on the plot axis and select Convert Units.
The Convert Units tool allows you to convert the current unit of measure of a horizontal or
vertical axis to another unit of measure. All curves associated with the axis are scaled accordingly
and the axis label is updated to reflect the new unit of measure.

The Coordinate Info panel can be accessed one of the following ways:
Click the Coordinate Info icon
Or
From the menu bar select Curves > Coordinate Info

30

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

This panel allows you to retrieve individual point data on any curve in the active window. When a
point is selected, its data is displayed in the panel.

To access TextView, use the Select Application menu and click TextView

The text editor window allows you to view, edit, and save text files, conduct text searches,
change text attributes, and evaluate Templex. With Templex, you can obtain curve data from the
plot window and display the results in text format in the text window
The Modify Curves panel can be accessed in one of the following ways:
Click the Modify Curves icon
Or
From the menu bar select Curves > Modify Curves.
The Modify Curves panel enables you to modify curve data pertaining to a plot. Curves can be
deleted, trimmed, bridged, or hidden within a specified range and orientation.

The Scales Offset and Axis Assignments panel can be accessed in one of the following ways:
Click the Scales Offset and Axis Assignments icon
Or
From the menu bar select Curves > Scales Offsets and Axis Assignments.
Curve scaling, offsets, and axis assignments can be applied to multiple curves using this panel.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

31

Exercise: Modify and Interrogate XY Curves


Step 1: Open Session File demo_3.mvw
1.

From the File menu click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/demo_3.mvw and


click Open.

Step 2: Using the Convert Axis Units tool to scale the Y axis.
1.

On page 2, activate window 1.

2.

Right-click on the windows vertical axis and select Convert Units from the pop-up menu.
The current selection in the Convert Axis Units dialog defaults to Time. This is because the
unit converter did not recognize the Y axis unit.

3.

Select Force from the dialog.


Select From: N from the drop-down menu.
Select To: kN from the drop-down menu.

4.

Click OK to apply the change and close the dialog.


The Y axis label is changed from Force to Force (kN). Also, the Y axis numbers and the
curves Y data are scaled by 0.001.

5.

Open the unit converter again for the same Y axis. Force is now selected as the tool
recognizes the axis unit of measure.

6.

Click Cancel to close the Convert Axis Units dialog.

Step 3: Change the Y axis label for window 1 to Force (kiloNewtons)


1.

Click the Axes panel icon,

The Primary axis is highlighted or active in the Axes list.


2.

Above the Axes list, select Vertical from the drop-down menu.

3.

From the Text tab, change Force (kN) to Force (kiloNewtons) and press ENTER to apply
the change.

Step 4: Creating a Datum Line


1.

Activate window 2 on page 2.

2.

Click the Datum Lines panel button,

32

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

3.

Click Add.

4.

Verify that the choice under the selection for Datum is Horizontal.

5.

Select the Positon tab.

6.

Verify that Axis is set to Primary.

7.

For Position, enter the expression sin(90) +100-cos(0) and press ENTER.

8.

Click the Line Attributes tab and select a different color for the line.

Step 5: Trim the curves.


1.

Activate window 3 on page 2.

2.

Click the Modify Curves icon,

3.

To the right of the Curves field, there is a curves button,

.
. Press this button.

The Select Curves dialog is displayed.


4.

Under p2:Force-2 select w3: XY plot and click OK


All curves in window 3 are selected and p2w3c1, p2w3c2, p2w3c3 are displayed in the
Curves text field.

5.

Verify the option for Direction is set to Horizontal.

6.

Under Range, specify 0.2 for From and press ENTER.

7.

Specify 0.95 for To and press ENTER.

8.

Under Action, click Trim to remove the data outside of the specified range for the selected
curves.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

33

Step 6: Create a secondary Y axis in a plot window.


1.

Click the Add Page icon,

2.

Go to the Build Plots panel,

3.

Open the file <installation_directory>/tutorial/mv_hv_hg/plotting/demo.dat.

4.

Select the option Layout: Use current plot.

5.

Create a curve for X type: Time, Y type: Force, Y Request: REQ/3 Curve3, and Y
Component: X.

6.

Create a second curve in the same plot window for X type: Time, Y type: Displacement, Y
Request: REQ/33 Curve33, and Y Component: X.

7.

Go to the Axes panel,

8.

From the drop-down menu above the Axis list select Vertical.

9.

Click Add to create a secondary vertical axis on the plot windows right side.

An axis with the name Y1 is created and its name is highlighted (active) in the Axis list.
10. In the Axis text field above the Axis list, rename the Y1 axis to disp and press ENTER.
11. On the Text tab, rename the Y1 axis label to Comp x disp and press ENTER.
12. Go to the Scales, Offsets, and Axis Assignments panel,
13. Verify the curve REQ/33 Curve 33-X

is highlighted.

14. Under Axis assignments, click on the Y: drop down, select disp and click Apply.
The secondary vertical axis is assigned to the curve REQ/33 Curve33-x.
15. Click Fit

to fit the curve to the plot window.

Step 7: In a text editor window using Templex, obtain information for


existing xy curves.
1.

Click on the Page Layout button

2.

Make the second window active

34

and select a two-window layout

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

3.

From the Select Application menu, select TextView

4.

Type the following text in the text editor window:

Maximum Force is {max(p3w1c1.Y)} Newton


Maximum Displacement is {max(p3w1c2.Y)} meter
5.

From the toolbar, click the Edit Text button,

The Templex statements are evaluated and displayed.


The text editor window is now in non-edit mode.

6.

Click the Edit Text button again to go back to edit mode.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

35

HG-1021: Modifying Plots with the Plot Browser


In this tutorial you will learn how to use the Plot Browser to perform the following tasks:
Modify the following plot attributes
o

Header font size

Legend position and font size

Axis fonts

Modify the following curve attributes


o

Curve name and prefix

Line style

Color

Add notes attached to curves

36

Modify notes in the Notes panel

Apply these changes to all notes using the Plot Browser

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Tools
The HyperGraph 2D Plot Browser resides on a tab in the Tab Area sidebar and allows you to view
the HyperGraph 2D plot structure.

The Plot Browser can be turned on or off using the View > Browsers > HyperGraph 2D > Plot
menu options. A check mark indicates that the HyperGraph 2D Plot Browser is activated for display
in the Tab Area.
You can use the Plot Browser tools to search, display and edit entities and their properties within
the current session.

Exercise: Modify the Plot and Curve Attributes


Step 1: Open Session File demo_browser.mvw.
1.

From the File menu click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/


demo_browser.mvw and click Open.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

37

Step 2: Modify the header font size.


1.

From the Plot Browser tab, click the Headers/Footers icon,


browser.

, from the top of the

These icons allow you to filter the data that is displayed in the Plot browser. For example, by
clicking the Headers/Footers icon, only the header and footer information for each curve in
your session is displayed in the browser.
2.

Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and
Header by clicking the plus button next to each folder.

3.

Right-click on Header and select Select All.

38

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

This action selects all the headers for each curve listed in the plot browser. By doing this, you
can modify a header attribute only once, but it will be applied to all headers.

4.

From the Properties Table at the bottom of the Plot Browser, select the font icon next to
Primary Font Settings.

The Font Selector dialog is displayed.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

39

5.

Change the Font Size to 20.


The font size change is applied to all headers.

Step 3: Modify the legend font size and change the legend position.
1.

From the Plot Browser tab, click the Legends icon,

, from the top of the browser.

These icons allow you to filter the data that is displayed in the Plot Browser. For example, by
clicking the Legends icon, only the legend information for each curve in your session is
displayed in the browser.
2.

Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and
Legends by clicking the plus button next to each folder.

3.

Right-click on Legends and select Select All.

40

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

This action selects all legends for each curve listed in the plot browser. By doing this, you can
modify a legend attribute only once, but it will be applied to all curve legends.

4.

From the Properties Table at the bottom of the Plot Browser, select the font icon next to
Font Settings.

The Font Selector dialog is displayed.


5.

Change the Font Size to 12.


The font size change is applied to all legends.

6.

Next, we will change the legend placement in the graphics window.

7.

From the Legend Placement drop-down menu, select Inside-Right-Bottom corner.


The legend is moved to that position.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

41

Step 4: Modify the axis font size.


1.

From the Plot Browser tab, click the Axes icon,

, from the top of the browser.

These icons allow you to filter the data that is displayed in the Plot Browser. For example, by
clicking the Axes icon, only the axes information for each curve in your session is displayed in
the browser.
2.

Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and
HorizontalAxis by clicking the plus button next to each folder.

3.

From the HorizontalAxis folder, right-click on Primary and select Select All.

This action selects all horizontal axes for each curve listed in the plot browser. By doing this,
you can modify a horizontal axis attribute only once, but it will be applied to all horizontal
axes.
IMAGE

4.

From the Properties Table at the bottom of the Plot Browser, select the font icon next to
Font Settings.
The Font Selector dialog is displayed.

5.

Change the Font Size to 12.


The font size change is applied to all horizontal axes.

6.

Repeat steps 1-5 for the VerticalAxes - Primary.


The font size change is applied to all vertical axes.

Step 5: Modify the curve name.


1.

From the filter icons at the top of the Plot Browser, select the Curves icon,

2.

Expand the folders for page 1 (p1: Angular Acceleration), window 1 (w1:XY Plot) and
Curve by clicking the plus button next to each folder.

42

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

3.

Right-click on the curve name c1:50th% Hybrid 3 - LOWER TORSO -Res ang and select
Select All.
All curve names in the Plot Browser are selected.
The curve names contain the request and component information.

Next, remove the Y Request from the curve name.


4.

From the Properties Table, click the Label drop-down menu and deselect the Y Request
option.
The curve names shown in the graphics area now only contain the Y Component name.

5.

Activate Show Label Prefix.

6.

In the Label Prefix field, enter Test 17.


The prefix Test 17 is added to the curve name label for all plots.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

43

Step 6: Modify the curve line style and color.


In this step, you will change the curve line style for all curves that contain the components XYZ.
1.

Keep the Curves icon selected at the top of the Plot Browser.

2.

Click the Add Filter icon,

3.

From the Filter Name drop-down menu, select Display Name.

4.

In the Value column, enter Res.

44

, to add a filter to the Filter Area.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HyperGraph searches for all the curve names that contain a resultant and display only those in
the Plot Browser.

5.

Right-click on the first curve listed in the Plot Browser and select Select All.

6.

Delete the filter you just added by clicking the Delete Filter icon,

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

45

The Plot Browser displays all the other curve names that contain something other than a
resultant.

46

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

7.

Click the Select Reverse icon,


, to deselect the curves with resultant in the name and
SELECT the curves with component in the name.

8.

From the Properties Table, select the Line Style drop-down menu and select the dashed line
style.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

47

The line style is changed to a dashed line style for all curves with component in the curve
name. The curve name that contains the resultant remains a solid line.

9.

To change the line color of only the resultant curve, click the Select Reverse icon again,
to deselect the component curves from the Plot Browser and select the resultant curve.

10. From the Properties Table, select the Line Color color square and select the color black from
the color palette.

48

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Only the resultant curve changes to black.

Step 7: Add and modify notes.


1.

Keep the Curves icon selected at the top of the Plot Browser.

2.

Click the Add Filter icon,

3.

From the Filter Name drop-down menu, select Display Name.

5.

In the Value column, enter Res.

, to add a filter to the Filter Area.

The Plot Browser displays only the curve names with resultant in the name.
5.

Right-click on the first curve name listed in the Plot Browser and select Select All to select all
the resultant curves in the Plot Browser.

6.

Again, right-click on the first curve listed in the Plot Browser and select Single Curve Math >
Max Note.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

49

This adds a note to the maximum value of each curve in the session.

Next, you will use the Notes panel to modify the note.
7.

From the toolbar, click the Notes icon,

8.

In the Text tab, change Max:{Y} to this: Max of {label} = {Y} and click Apply.
The note now displays the label information.

9.

You can further edit the note display by added quotes around {label}, like this: Max of
"{label}" = {Y}. Click Apply.

10. Edit the note one more time by adding the time to it, like this:

50

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

The "ms" displays the time in milliseconds.

Next, you will apply the note text to all the curves in the session using the Plot Browser.
11. From the Notes panel, highlight the note text and press CTRL+C to copy the text.
12. Click the Notes icon on the Plot Browser.
13. Right-click on Note 1 and select Select All to select all notes in the session.
14. From the Properties Table, click in the Text field.
15. Notice the rectangular button that appears:

. Click on it to display the Edit String dialog.

16. Press CTRL+V to insert the text you copied from the Notes panel and click OK.
All max notes now have the same text string applied to them.

17. Click the Font Settings font icon and change the note font size to 12.
All notes in the session are displayed with the same note attributes.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

51

HG-1030: Referencing and Filtering Curves


In this tutorial you will learn how to reference and filter curves.

Tools
The Define Curves panel can be accessed in one of the following ways:
Click on the Define Curves icon
Or
From the menu bar select Curves > Define Curves.
This panel allows you to edit existing curves and create new ones. The Define Curves panel also
provides access to the program's curve calculator.

Referencing Curve Vectors in HyperGraph


X and y vector expressions can reference any curve vector in the session. A curve vector
reference defines the x or y vector (values) by page, window, and curve number. An example of a
curve vector reference is p2w3c4.x, where:
p2

is page 2

w3

is window 3

c4

is curve 4

is the vector

52

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

There are two common methods to specify curve vector references:


Pick a curve in a plot For the x =
window
input field.

SHIFT and pick the curve to get the curve x vector


reference
SHIFT + CTRL and pick the curve to get the curve y
vector reference

for y = input
field.

SHIFT and pick the curve to get the curve y vector


reference
SHIFT + CTRL and pick the curve to get the curve x
vector reference

Select a curve vector reference from the Curves dialog, which is accessed from the Define
Curves panel.

Exercise: Filtering a curve


Step 1: Open Session File saefilter.mvw
1.

From the File menu, click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/saefilter.mvw


and click Open.

Step 2: Filter a curve using the SAE J211/1 filter.


1.

Click on the Define Curves panel button

2.

Click Add and add a new curve.

3.

Change the name of the new curve from Curve 1 to SAE J211/1 FILTER in the text box over
the curve list.

4.

Check the radio button for Math under Source:.

5.

Verify that the x vector is active.

6.

Hold the SHIFT key and click on the curve in the plot window.
The x = curve reference is p1w1c1.x.

7.

Click the y = field, and click Filter from the panel menu to display the Filter dialog.

8.

Select the filter class SAE J211/1 from the Filter Class drop-down menu.

9.

Select Filter Class: 60, Padding: Mirror padding, and Direction: Fwd-Back.

10. Click OK to complete the selection and close the Filter dialog.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

53

11. Hold down the SHIFT + CTRL keys, then select the existing curve.
12. The x vector curve reference is entered in the saefilt95 function.
13. Hold down the SHIFT key and select the curve again.
Note: the curve's y vector is referenced in the saefilt95 function. The y = field should read:
saefilt95(p1w1c1.x,p1w1c1.y,60,1,3).
14. Click Apply to create the filtered curve.

54

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HG-1040: AVD Diagram Using Unit Scaling and Plot Browser


In this tutorial you will learn how
To create an Acceleration Velocity Displacement plot in one window
To use the unit scaling feature for a plot.
To use the Plot Browser to change the appearance of a plot, such as modifying the axes
names, unit type and curve line color.

Tools
The Build Plots panel can be accessed one of the following ways:
Click the Build Plots icon,
OR
From the menu bar select Curves > Build Plots.
This panel allows you to construct multiple curves and plots from a single data file. Curves can be
overlaid in a single window or each curve can be assigned to a new window.

The Plot Browser resides on a tab in the Tab Area sidebar and allows you to view the HyperGraph
2D plot structure. The Plot Browser tools allow you to search, display and edit entities and their
properties within the current session. The plot structure is viewed as a flat, listed tree structure
within the browser. However, if the plot has a hierarchy, then the Plot Browser accommodates
this hierarchical structure.
From the Plot Browser, you can select entities one at a time or several simultaneously using
common selection techniques. You can also use the browser's context-sensitive menus to select
entities. Using the Plot Browser, you can perform many of the operations available in the
HyperGraph 2D panels, thus allowing you to modify your plot and curve properties in one location.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

55

Step 1: Clear any units association and enable unit scaling.


1.

From the Tools menu, select Reset Units Association.


The Reset Units Association dialog is displayed.

2.

If activated, click Reset Units to clear any unit associations. If Reset Units is grayed out,
you don't need to do anything.

3.

Click Close to close the dialog.

4.

From the toolbar, click the Options icon,

The Options panel is displayed.

5.

56

From the Options dialog, make sure Enable Unit Scaling and Show Units Dialog are
activated.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Open the nodout file.


1.

From File menu, select New > Session to clear all contents in the HyperGraph session.

2.

Verify XY Plot is selected from the plot type menu,

3.

Click the Build Plots icon,

4.

Click the Open File icon,


, and open the file <installation_directory>/demos/
mv_hv_hg/plotting/dyna/nodout.

Step 3: Plot the curves and set the curve units.


1.

Return to the Build Plots panel,

2.

For the X Type: select Time.

3.

From the Y Type: column, select Node Data.


The data available in the file is listed under the Y Request column.

4.

From the Y Request: column, press and hold the CTRL key and select Nodal Point 2500001
and Nodal Point 2500002.

5.

From the Y Component: column, select X Displacement, X Velocity and X Acceleration

6.

From the Layout drop-down menu, select Use Current Plot.

7.

Click Apply to create the curves on page 1.


The Units Profile dialog is displayed.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

57

8.

From the Units Profile dialog, select the C radio button and click OK.
This sets the Length, Time and Mass units for the file to millimeter, milliseconds, and
kilograms, respectively.

9.

Click OK to close the Select Units Profile dialog.


The curves are plotted and the units for the vertical and horizontal axis are changed to
millimeters and milliseconds, respectively.

10. Click Apply.


The displacement, velocity and acceleration are plotted. Notice that two additional axes have
been added to the right of the window to accommodate the velocity and acceleration data.
(use your plot with your default settings.

58

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 4: Modify the plot's appearance and rename an axis.


In this step, you will use the Plot Browser to change the appearance of the plot.
1.

From the Plot Browser, click the Axes icon,

2.

Expand the folders for page 1 (p1: Node Data), window 1 (w1:XY Plot) and VerticalAxis by
clicking the plus button next to each folder.

3.

The following axes are listed in the VerticalAxis folder: Primary, Y1 and Y2.

4.

Select the Primary axis.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

59

5.

From the Properties Table, located in the bottom portion of the Plot Browser, click the color
palette next to Color and select black.

6.

From the VerticalAxis folder, select the Y1 axis

7.

From the Properties Table, click the color palette next to Color and select red.

8.

Change the color for the Y2 axis to blue.

Next, you will rename the axes using the Plot Browser.
9.

From the Plot Browser and VerticalAxis folder, select the Primary axis.

10. From the Properties Table, click the Name field and enter the name Displacement.
11. Repeat steps 9 and 10 for the Y1 and Y2 axes. Rename them Velocity and Acceleration,
respectively.
The new vertical axes names for Primary, Y1 and Y2 are shown below:

60

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 5: Modify the curve line color.


1.

From the Plot Browser, click the Curve filter icon,

2.

Expand the folders for page 1 (p1: Node Data), window 1 (w1:XY Plot) and Curve by clicking
the plus button next to each folder.

3.

Select the two Displacement curves from the list for nodal points 2500001 and 2500002

4.

From the Properties Table, next to Line Color, click the color palette and select black.
This changes the color of those two curves to black.

5.

From the same expanded Curves folder, select the X Velocity curves.

6.

From the Properties Table, change their line color to red.

7.

Select the X Acceleration curves and change their line color to blue.

8.

From the Plot window, right-click on the horizontal axis to display the following context menu:

9.

Select Convert Units and change the unit type from milliseconds to seconds (s).

10. From the Plot window, right-click in the vertical axis and select Convert Units. Change the
distance from millimeters to meters.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

61

11. Repeat step 8, but for the right-side Velocity axis. Change the speed from millimeters/
milliseconds to mph.
12. You can also change the unit type for a curve by right-clicking on the curve and selecting
Enable/Change Curve Unit.
The Enable/Change Curve Unit dialog is displayed.

13. From the YVector, select the right-most drop-down menu and change the unit from millimeter/
millisecond to kph.
14. Click OK.
The final plot window is shown below:

62

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Advanced Curve Manipulation


HG-2000: Evaluating Curve Data
HG-2010: Creating a Plot Macro

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

63

HG-2000: Evaluating Curve Data


In this tutorial you will learn how to:
Reference curves
Create curves using math expressions
Create curves by using pre-defined functions
Use the freeze option

Tools
The Define Curves panel can be accessed in one of the following ways:
Click the Define Curves icon
Or
From the menu bar select Curves > Define Curves.
This panel allows you to edit existing curves and create new ones. The Define Curves panel also
provides access to the program's curve calculator.

Referencing Curve Vectors in HyperGraph


X and Y vector expressions can reference any curve vector in the session. A curve vector
reference defines the x or y vector (values) by page, window, and curve number. An example of a
curve vector reference is p2w3c4.x, where:
p2

is page 2

w3

is window 3

c4

is curve 4

is the vector

64

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

There are two common methods to specify curve vector references:


Pick a curve in a For the x =
plot window
input field

SHIFT and pick the curve to get the curve x vector reference

SHIFT + CTRL and pick the curve to get the curve y vector
reference
for y =
input field

SHIFT and pick the curve to get the curve y vector reference

SHIFT + CTRL and pick the curve to get the curve x vector
reference
Select a curve vector reference from the Curves dialog, which is accessed from the Define
Curves panel.

Freeze Option
The Freeze option is available when a vectors source is Math. This option allows you to break the
association of the dependent curve(s) from their parent curve, which allows modifications to the
parent curve without updating the dependent curve(s).

Curve Dependencies browser


To access the browser, right-click a curve and select View Dependencies. The selected curve
displays from the context menu.

Exercise: Creating XY Curves by Referencing Existing


Curve Vectors
Step 1: Open Session File democ2.mvw.
1.

From the File menu, click Open > Session.

2.

Select the file <installation_directory>/tutorials/mv_hv_hg/plotting/democ2.mvw and


click Open.

Step 2: Practice referencing curve vectors by selecting curves from the


plot window.
1.

Make window 3 (lower left window) on page 2 active by clicking on it.

2.

Expand window 3 by clicking the Expand Window button,

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

65

3.

Go to the Define Curves panel,

The Curve list displays the names of the four curves in window 3.
4.

Click Add under the curve list.

5.

Verify the x = radio button is selected.

6.

Select Math under Source of the curve to be created.


This defines the x vector of the new curve to be a math function. In this case, it will simply be
set equal to the x vector of an existing curve.

7.

Hold the SHIFT key and pick the dark red curve (Req/5 Curve 5).
The x = curve reference is p2w3c2.x. This defines the page 2, window 3, curve 2, x vector.

8.

Clear the entry in the x = field.

9.

With the x = field still active, hold the SHIFT + CTRL keys and pick the same curve.
The x = curve reference is p2w3c2.y. This defines the page 2, window 3, curve 2, y vector.

10. From the curve list, select Curve1 and click Cut.
11. Return to the pages original layout by clicking

66

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Create a new curve with a math expression for its y vector.
1.

Click Add to create a new curve named Curve2.

2.

Verify the x = radio button is selected.

3.

Select Math for the Source:.

4.

Click Curves to open its dialog.


Select p2: Plot 2.
Select w3: Plot.
Select c2: Req/5 Curve 5.

5.

Click Select to complete the selection


The result is the same as when the curve was picked from the graphics area; the x curve
reference is p2w3c2.x.

6.

Click the y = radio button.

7.

Hold the SHIFT key and pick any curve in window 3.


Notice in the y = field is the reference for the y vector of the picked curve.

8.

Append the character + to the string in the y = field.

9.

Hold the SHIFT key and select any other curve in window 3.
Notice the y = field now has two y vectors separated by the + sign.

10. Click Apply to create the new curve.


The new curve appears in window 3 and is the sum of the two y vectors.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

67

HG-2010: Creating a Plot Macro


In this tutorial you will learn how to:
Create a plot macro
Append and use the Vehicle Safety Tools

Tools
The Plot Macro panel can be accessed in one of the following ways:
Click the Plot Macros icon
Or
From the menu bar select Curves > Plot Macros
This panel allows you to create macros that produce curves and notes for plots. Plot macros can
be used to capture and replay frequently used curve operations such as adding two curves
together and filtering curves.

Defining a plot macro consists of two steps:


1.

Define the parameters (variables of type curve or scalar) needed to create the curve.

2.

Define the curve using the parameters.

Plot macros created from the Plot Macros panel are saved to the session file.

68

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

To load Vehicle Safety Tools:


1.

From the menu bar select File > Load > Preference File.

2.

Select the Vehicle Safety Tools preference file and then click Load.

The vehicle safety tools (VST) are a collection of over 200 macros, Templex functions, and
external functions used by vehicle safety engineers. On appending the VST file, six new menus
that contain the macros and functions are displayed on the menu bar: Math, Filter, Units, Injury,
Misc, and Transforms.

Selecting a tool (macro) from one of these menus takes you to the Plot Macros panel.

Context Sensitive Menu


When the VST are loaded, you can access its macros by right-clicking on a curve and selecting a
macro from the pop-up menu. The pop-up menu can be customized.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

69

Exercise: Create a Plot Macro for the SAE J211 Filter


Function
Step 1: Define the macros first parameter.
1.

Click on the Plot Macros panel icon

2.

Click Add to create a new macro and open the Edit Plot Macro dialog.

3.

On the Parameters tab, click Add to create the first parameter.


A parameter named Paramenter1 is displayed in the Parameters list and is highlighted.

4.

In the Parameter: field, replace the name Parameter1 with raw data curve and then press
ENTER.

5.

In the Varname: field, replace the name p_1 with curve and press ENTER.
The variable name references the parameter in the macro's definition.

6.

70

Set the parameters Type: to Curve.

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Define the macros second parameter.


1.

Click Add to create the second parameter.

2.

In the Parameter: field, replace the name Parameter2 with SAE J211/1 filter class.

3.

In the Varname: field, replace the name p_2 with class.

4.

Set the parameters Type: to Scalar.

Step 3: Define the macros third parameter.


1.

Add a third parameter.

2.

Change the parameters name to padding.

3.

Change the parameters variable name to padding.

4.

Verify Type: is set to Scalar.

Step 4: Define the macros fourth parameter.


1.

Add a fourth parameter.

2.

Change the parameters name to direction.

3.

Change the variables name to direction.

4.

Verify Type: is set to Scalar.

Step 5: Define the macros curve label.


The curve label should be curve.label+" SAE J211/1 "+class.
1.

From the Curve tab, click the Label field.

2.

From the Parameters list, double-click raw data curve.


curve.label is displayed in the Label field.

3.

In the Label field, add +" SAE J211/1 "+.


curve.label+" SAE J211/1 "+ is displayed in the Label field. The + symbol connects the
string of variables and text.

4.

From the Parameters list, double-click SAE J211/1 filter class.


curve.label+" SAE J211/1 "+class is displayed in the Label field.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

71

Step 6: Define the curves x vector.


The curves x vector should be curve.x.
1.

Click the X: field.

2.

From the Parameters list, double-click raw data curve.


curve.x is displayed in the X: field.

Step 7: Define the curves y vector.


The curves y vector should be saefilt95(curve.x,curve.y,class,padding,direction).
1.

Click in the Y: field.

2.

From the Functions: list, double-click saefilt95.


saefilt95(,,,,) is displayed in the Y field.

3.

From the Parameters list, double-click raw data curve.


saefilt95(curve.y,,,,) is displayed in the Y field.

4.

In the Y field, change curve.y to curve.x.

5.

Position the cursor after the first comma.

6.

From the Parameters list, double-click raw data curve.


saefilt95(curve.x,curve.y,,,) is displayed in the Y field.

7.

Position the cursor after the second comma.

8.

From the Parameters list, double-click SAE J211/1 filter class.


saefilt95(curve.x,curve.y,class,,) is displayed in the Y field.

9.

Position the cursor after the third comma.

10. From the Parameters list, double-click padding.


saefilt95(curve.x,curve.y,class,padding,) is displayed in the Y field.
11. Position the cursor after the fourth comma.
12. From the Parameters list, double-click direction.
saefilt95(curve.x,curve.y,class,padding,direction) is displayed in the Y field.
13. Close the Edit Plot Macro dialog.
14. In the Macro: field, change the name macro1 to SAE J211/1 filter and press ENTER.

72

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

15. Save the session file as SAEJ211_macro.mvw.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

73

Step 8: Apply the SAE J211/1 filter macro.


1.

From the menu bar select File > Open > Session and select the file
<installation_directory>/tutorials/mv_hv_hg/plotting/saefilter.mvw.
Even though a new session file is opened, the SAE J211/1 filter macro remains in the
session until HyperGraph is closed.

2.

Enter the Plot Macros panel.

3.

From the Macro list, select SAE J211/1 filter.

4.

In the Parameters section of the Plot Macros panel, click the raw data curve field.

5.

Hold the SHIFT key and select the curve in the plot window.
p1w1c1 is displayed in the raw data curve field.

6.

Enter 60 in the SAE J211/1 filter class field.

7.

Enter 1 in the padding field.

8.

Enter 3 in the direction field.

9.

Verify the option Layout: Place new curves in original plots is active.

10. Deactivate the option Hide input curves.


11. Click Apply to create the filtered curve.
This plot macro can be reused for any number of input curves to quickly repeat the curve
filtering process.

74

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

More Plotting
HG-3000: Working with Bar Charts
HG-3010: Working with Complex Plots
HG-3020: Working with Polar Plots

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

75

HG-3000: Working with Bar Charts


In this tutorial, you will learn how to create bar charts by entering values, importing a data file, or
specifying a mathematical expression.

Tools
When the plot type is set to Bar Charts (
), the Define Curves panel allows you to add and
edit bar charts in the active plot window. It can be accessed one of the following ways.
Click on the Define Curves panel button

on the toolbar

Or
From the menu bar select Curves > Define Curves

Bar charts are comprised of data and categories. Data can be entered as values, read from an
external file, or defined as a mathematical expression.

Exercise: Create Bar Charts


Step 1: Create a bar chart by entering values in the Define Curves panel.
Enter the values 563.35, 567.22, and 423.51.
1.

From the menu bar select File > New > Session to clear the contents of the current session.

2.

From the plot type menu, select Bar Chart,

3.

Enter the Define Curves panel,

4.

Click Add to create a new bar chart named Curve 1.

Curve 1 is highlighted in the series list to indicate it is the active series.


5.

In the Series field above the bar chart list, rename Curve 1 to Nodal Point 1 and press
ENTER.

6.

Under Source, select Values.

76

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

7.

8.

In the panels center, under the column Nodal Point 1, type these three values:
Index 1:

563.35

Index 2:

567.22

Index 3:

423.51

Click Apply to create the bar chart.

Step 2: Create a bar chart by importing values from the data file
nodal_values.dat.
1.

Add a second bar chart to the current plot window.

2.

Rename Curve 2 to Nodal Point 2.

3.

Under Source, select File.

4.

Click the file browser next to File: and open the file <installation_directory>/tutorial/
mv_hv_hg/plotting/nodal_values.dat.

5.

Leave Type: set to Unknown.

6.

Leave Request: set to Block1.

7.

Leave Component: set to Column1.

8.

Click Apply to create the bar chart.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

77

Step 3: Create a bar chart using a math expression.


1.

From menu bar select File > Import > Session and open the session file bar_chart.mvw.
A second page containing an XY Plot window with three XY data curves is added to the
session and is currently displayed.

2.

Go back to the sessions page 1, which contains the bar chart.

3.

Add a third bar chart to the current plot window.

4.

Rename Curve 3 to Nodal Point 3.

5.

Under Source, select Math.

6.

In the Expression: field, type the following math expression:


{max(p2w1c1.y),max(p2w1c2.y),max(p2w1c3.y)}

7.

Click Apply to create the bar chart.

78

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 4: Modify category labels.


1.

In the Categories column, click One, rename it x disp, and click Apply to update the bar
charts label.

2.

Rename category Two to y disp.

3.

Rename category Three to z disp.

4.

Click Apply to update the bar charts labels.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

79

HG-3010: Working with Complex Plots


In this tutorial you will learn how to:
Create complex plots from a data file
Add and edit complex data curves by using mathematical functions

Tools
The Build Plots panel can be accessed in one of the following ways:
Click the Build Plots icon

from the toolbar

Or
From the menu bar select Curves > Build Plots
The Build Plots panel constructs multiple curves and plots from a single data file. Curves can be
overlaid in a single window or each curve can be assigned to a new window. Individual curves are
edited using the Define Curves panel.

The Define Curves panel can be accessed in one of the following ways:
Click the Define Curves panel button

from the toolbar

Or
From the menu bar select Curves > Define Curves
Existing curves can be edited individually and new curves can be added to the current plot using
the Define Curves panel. The Define Curves panel also provides access to the program's curve
calculator.

80

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Exercise: Plot Complex Data and Apply Math Functions


Step 1: Build a complex data curve from a data file.
1.

From the menu bar select File > New > Session to clear the contents of the session.

2.

From the plot type menu, select Complex Plot

3.

Enter the Build Plots panel

4.

Use the file browser button to open the file <installation_directory>/tutorials/


mv_hv_hg/plotting/control_arm_sol111.pch.

5.

Leave the X type: set to Frequency [hz].

6.

In the Y type: column, select Subcase 1 Displacements.

7.

In the Y Request: column, select Point id 2086.

8.

In the Y Component: column, select X-Rot.

9.

Click Apply to create the complex curves.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

81

Step 2: Apply the Inverse Fast Fourier Transform (ifft) math function to the
complex data curve.
1.

Change the current window layout of page 1 to a two-window layout

2.

Activate the window on the right side.

New plot windows are set to the xy plot type by default.


3.

Set the plot type for the window on the right side to XY Plot.

4.

Enter the Define Curves panel

5.

Add a new XY plot curve named Curve 1.

6.

Rename Curve 1 to ifft_curve.

7.

Under Source, select Math.

8.

In the x: field, enter p1w1c1.x.

9.

In the y: field, enter ifft(p1w1c1.ym,p1w1c1.yp).

10. Click Apply to create the XY data curve.

82

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Create a complex data curve of frequency versus displacement for


Subcase two, node 2086, x-rotation.
1.

Activate window 1 (the left window).

2.

Enter the Build Plots panel

3.

In the Y type: column, select Subcase 2 Displacements.

4.

In the Y Request: column, select Point id 2086.

5.

In the Y Component: column, select X-Rot.

6.

Click Apply to create the complex curves.

Step 4: Subtract the Subcase two curve from the Subcase one curve.
1.

Change the current window layout for page 1 to a three-window layout,

2.

Make the new, blank plot window active.

3.

From the plot type menu, select Complex Plot.

4.

Enter the Define Curves panel.

5.

Click Add P/M to create a new complex curve.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

83

6.

Rename Curve 1 to sub_disp.

7.

Under Source, select Math.

8.

In the x: field, enter p1w1c1.x.

9.

In the yp: field, enter p1w1c2.yp - p1w1c1.yp.

10. In the ym: field, enter p1w1c2.ym - p1w1c1.ym.


11. Click Apply to create the complex curve.

84

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HG-3020: Working with Polar Plots


In this tutorial, you will learn how to:
Create polar plots from a data file.
Add polar plots by using mathematical functions.

Tools
The Build Plots panel can be accessed in one of the following ways:
Click the Build Plots button,

, from the toolbar

Or
From the menu bar select Curves > Build Plots.
The Build Plots panel constructs multiple curves and plots from a single data file. Curves can be
overlaid in a single window or each curve can be assigned to a new window. Individual curves are
edited using the Define Curves panel.

The Define Curves panel can be accessed in one of the following ways:
Click the Define Curves button,

, from the toolbar

Or
From the menu bar select Curves > Define Curves
Existing curves can be edited individually and new curves can be added to the current plot using
the Define Curves panel. The Define Curves panel also provides access to the program's curve
calculator.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

85

Exercise: Plot Polar Data and Add Plots


Step 1: Build a polar data plot from a data file.
1.

From the menu bar select File > New > Session to clear the contents of the session.

2.

From the plot type menu, select Polar Plot,

3.

Enter the Build Plots panel,

4.

Use the file browser button to open the file modal_participation.f06 located in tutorials
\mv_hv_hg\plotting.

5.

Leave the Subcase: field set to Subcase 11.

6.

Leave the Data Type: field set to Frequency.

7.

From the Type: column, select Modal Participation.

8.

From the Request: column, select FLUID Node 5417.

9.

From the Component: column, select Mode 1, Mode 3 and Mode 5.

10. Click Apply to create the polar plots.


The vectors are plotted at a frequency of 100.0Hz.

86

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

11. Access the Frequency dialog by clicking the listed frequency value in the bottom left region
of the plot area.
12. Select the 128.0Hz frequency and click OK.
The vectors are plotted at 128Hz frequency.

Step 2: Add polar data.


1.

Use the Page Layout button,


layout.

, to change the window layout of page 1 to a two-window

2.

Activate the window on the right side.

3.

Change the plot type for the new window to Polar Plot.

4.

Enter the Define Curves panel.

5.

Add a new polar plot curve named Curve 1 by selecting Add R/I.

6.

Rename Curve 1 to Summation by typing the new name in the Curve: field and pressing the
ENTER key.

7.

Under Source, select Math.

8.

In the Frequency= field, enter p1w1c1.f.


A frequency field is specified to allow HyperGraph to compute the summation vector for every
frequency. In this case, the summation vector can be animated or updated when a certain
frequency is chosen.

9.

Select the Real = radio button and then select Math as the Source.

10. In the Real = field, enter p1w1c1.yr + p1w1c2.yr + p1w1c3.yr.


11. In the Imaginary = field, enter p1w1c1.yi + p1w1c2.yi + p1w1c3.yi.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

87

12. Set the Type: field to Vector Plot.


13. Click Apply to create the polar plot.
14. Access the Frequency dialog by clicking the listed frequency value in the bottom left region
of the right hand side of window 2.
15. Choose the 128.0Hz frequency and click OK.
The summation vector is now plotted at 128Hz frequency.

88

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

16. Change the Type: field to Phase vs Mag. Notice how a Phase vs Magnitude curve for all
frequencies is shown as a line connecting the tips of the vectors at different frequencies.

17. Click the start animation button,

Notice how the summation of vectors is updated in the animation for each frequency value in
the list.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

89

Templates
HG-4000: Creating an Export Template

90

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

HG-4000: Creating an Export Template


In this tutorial, you will learn about:
Export template language
How to register the template
How to export plot data to a file

Tools
Export Template: is a file that contains instructions for exporting curve data into files. The
instructions contained in an Export Template file are in an uncompiled type of programming
language called Export. An Export Template tells the program in which format the data should be
written into the file.
Templex and Export Template Language Statements
The language of Export Templates follows a mixture of Templex commands plus some additional
special statements. For the export of curves only a few statements are needed:
Templex Commands
indexofmin(i)

Index of the minimum of a vector (not the minimum itself)

numpts(x)

Dimension of the vector X

table()

Export of vectors organized in columns

for endloop

Loop

if else endif

Logics

Special Export Commands


cr()

New line

curvex(i)

X vector of curve i

curvey(i)

Y vector of curve i

curvelabel(i)

Export of the legend of curve i

list

Export of vectors in rows

margins(0,30)

Length of a line

numcurves()

Number of curves in a window

End of a command (except loops and logics)

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

91

Registering an export template:


The format selection list in the Export Curves... panel contains, by default, ten formats. Via the
preferences file, registered templates are added to this list. Registration is done using the
preferences file or via the Tools menu.
1.

Go to <installation directory>\hw\prefinc.

2.

Open preference_plot.mvw and add the following command that registers an export template
with a session.
*BeginDefaults()
*BeginPlotDefaults()
*AddExportFormat(par1,/homes/.../_madymo_export.tpl,par2)
*EndPlotDefaults()
*EndDefaults()

Above is a small sample of a preference_plot.mvw file that registers a new template


(madymo_export.tpl) with a session.
This file allows the user to customize sessions by specifying defaults or defining external
files that should be able to interact with the users session.
Note: The content of the parameter par1 is the name that shows up in the selection list. The
parameter par2 specifies the extension of the files that is used for exporting the data:
export.par2.

92

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Exercise: Export Template Example for MADYMO


Step 1: Create a Template that makes a file format for a function in
MADYMO
1.

Add the commands below to a text file named madymo_export.tpl.


The statement on the right is an explanation of the command.

{
Row_1="!vehicle acceleration";

Set variable for the comment in line1

Set number of curves

nc = numcurves();
lc = nc - 1

for (i = 0; i < nc; i++)

Loop for the number of curves

x = curvex(i);

Set the x-vector of curve i

y = curvey(i);

Set the y-vector of curve i

t = numpts(x);

Set the number of points

if (!numpts(x))

If curve is switched off dont export

else
Row_1; cr();

Output for Line 1, label

t, %5i; cr();

Output for Line 2, number of points

table(x, y, "%10.6f %11.6f", 0, t - 1); Output Line 3 to t-1 with the table
command
endif

if (i != lc)

After every exported curve set an empty


line

cr();
endif

endloop
}

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

93

Step 2: Register the Export Template.


1.

From Tools menu, select Readers, Writers, and Functions .

2.

Go to Export Templates tab.

3.

Browse the template created for Madymo.

4.

Give the Template a name.

5.

Click Register and OK.

94

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Export plot data:


1.

From the File menu, select Export > Curves.

2.

Enter a file name for the destination file.


-Or Select an existing file using the file browser.

3.

For Format, select the file you just registered.

4.

Specify a range of pages.

5.

Click Apply.
Plot data from the specified pages are exported to the file.

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

95

RESULT:
The below data file is created after exporting curves in this Madymo format:
!vehicle acceleration
151
0.000000

13.591910

1.000000

12.144580

2.000000

10.850770

3.000000

10.180930

4.000000

9.921851

5.000000

9.995111

6.000000

10.342690

7.000000

11.209030

...
...
147.000000

132.563400

148.000000

130.487300

149.000000

129.073800

150.000000

127.332800

96

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Customization
HG-5010: Customizing the Environment

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

97

HG-5010: Customizing the Environment


In this tutorial, you will learn how to customize the program using the preference file.

Tools
The Preference File:
A preference file is a script file that is read each time the program is started. It specifies default
user settings such as the order in which colors are assigned, the default printer, default page
layout, the auto save interval, and so on. A standard preference file can be created in the
program installation directory which is executed every time a license is activated. An additional
preference file can be created in your working directory that contains personal settings that either
overwrite the standard preference file or are added to the existing settings in the standard
preference file.
The HyperWorks installation contains two preference files located under $ALTAIR_HOME/hw:
All HyperWorks desktop products, except HyperStudy: preferences.mvw
HyperStudy only: preferences_hst.mvw
Seven include preference files are contained in the installation. These include preference files
must be included in the main preference file, as they cannot be used as independent preference
files. They are located under $ALTAIR_HOME/hw/prefinc.
Organization of the Preference File
The following describes the standard structure of the preferences file, containing five principal
blocks.
*BeginDefaults()
*EndDefefaults()
*BeginDefinitions()
*EndDefinitions()

*BeginStatsTemplates()
*EndStatsTemplates()

*BeginPlotMacros()
*EndPlotMacros()

*BeginTemplexFunctions()
*EndTemplexFunctions()
The *BeginDefaults() block is unique to a preference file while the *BeginDefintions(),
*BeginStatsTemplates(), *BeginPlotMacros(), and *BeginTemplexFunctions() blocks are the
same as those found in script files.

98

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

The following are general concepts for each of these sections:


*Id statement
The syntax for the *Id statement is: *Id("Release") where the release gives the program name and
version.
For example: *Id("HyperGraph v8.0")
The *BeginDefaults - *EndDefaults block
The *BeginDefaults() block is comprised of general defaults and seven subordinate statement
blocks. The general defaults are declared first, and then as many sub-blocks as required. Each
sub-block has the same structure as the main block. This means there is a *Begin statement,
followed by the necessary statements, and closing the block with an *End statement.
General defaults
General defaults include the autosave interval, bubble help status, and default printer settings. The
block is delimited by these statements:
*BeginDefaults()
*EndDefaults()
Model defaults
Model defaults are used to customize the model tool bar and to add MDL defaults for submitting
mechanical system models to a solver. The block is delimited by these statements:
*BeginModelDefaults()
*EndModelDefaults()
Graphic defaults
Graphic preferences such as model orientation and the part attributes are specified in the graphics
default block. The block is delimited by these statements:
*BeginGraphicDefaults()
*EndGraphicDefaults()
Plot defaults
Plotting preferences for curves including colors, fonts, and note defaults are specified in the
plotting defaults block. The block is delimited by these statements:
*BeginPlotDefaults()
*EndPlotDefaults()

Altair Engineering

HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

99

TextEditor defaults
TextEditor preferences including text and background color and font settings are specified in the
text editor defaults block. The block is delimited by these statements:
*BeginTextEditorDefaults()
*EndTextEditorDefaults()
Page header defaults
Page headers are specified in the page header block. The block is delimited by these statements:
*BeginHeader()
*EndHeader()
Page footer defaults
Page footers are specified in the page footer block. The block is delimited by these statements:
*BeginFooter()
*EndFooter()
To help you avoid compile problems, when you begin each block, start with the *Begin and *End
block statements, then enter the remaining statements between the block delimiters.

Exercise: Changing the default setting through the


preference file.
Step 1: Set the auto save default.
1.

Select TextView window mode.

2.

Open the file <install_directory>/tutorials/mv_hv_hg/preferences/


autosave_bubble_help.mvw by selecting File > Open > Document from the menu bar.

3.

After the *BeginDefaults() line, add the following preference statement


*SetAutoSaveInterval(2)
This sets the autosave interval to two minutes. If this statement does not appear in the
preferences.mvw file, the program sets the autosave interval to 10 minutes.

4.

Save the new preference file to your home directory as new_autosave_bubble_help.mvw by


selecting File > Save As > Document from the menu bar.

100 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Observe the updated AutoSave default.


1.

Start the program.

2.

Set the preference file by selecting File > Load > Preference File.
This opens a window which lists all the registered preference files.

3.

Select Register and then browse for the file new_autosave_bubble_help.mvw.

4.

Select new_autosave_bubble_help.mvw from the list of Registered Preferences and then


click Load to load the preference file. Click the red X in the upper right corner to close the
window

5.

Wait for approximately two minutes and then list the contents of your working directory.
A new file autosave.mvw will be present and contain a back up of the current session.

Altair Engineering

HyperGraph 2D 13.0 Tutorials 101


Proprietary Information of Altair Engineering

Step 3: Set the curve defaults.


1.

Select TextView window mode.

2.

Open the file <install_directory>/tutorials/mv_hv_hg/preferences/


curve_defaults.mvw by selecting File > Open > Document from the menu bar.

3.

After the *BeginPlotDefaults() line, add the *ResetCurveDefaults() statement to ignore


all previous *SetCurveDefaults() statements.

4.

After the *ResetCurveDefaults() line, add the following preference statements to set the
curve defaults:
*SetCurveDefaults(1, 7, 0, 0, 0)
*SetCurveDefaults(3, 16, 1, 0, 0)
*SetCurveDefaults(5, 24, 2, 0, 0)
*SetCurveDefaults(2, 32, 3, 0, 0)
*SetCurveDefaults(4, 40, 0, 0, 0)
*SetCurveDefaults(5, 48, 1, 0, 0)
A plotting preference block can contain several *SetCurveDefaults() statements. The
program assigns curve attributes sequentially.

5.

Save the new preference file to your home directory as new_curve_defaults.mvw by


selecting File > Save As > Document from the menu bar.

102 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 4: To observe the updated curve default settings:


1.

Click the Add Page icon

to add a new page to the current session.

2.

Select HyperGraph 2D from the Select Application menu.

3.

Change the Page Window Layout to two windows per page,

4.

Click Build Plots on the plotting toolbar.

5.

Open a plotting file:

Click the file browser.


Select the file <install_directory>/tutorials/mv_hv_hg/plotting/ANGACC.
Click Open.
6.

Select the data components and channels to plot:


Select Angular Acceleration from the Y Type list.
Select 50th% Hybrid3 LOWER TORSO from the Y Component list.
Select the All button from the Y Channel list.

7.

Click Apply.

8.

Set the file new_curve_defaults.mvw as the preference file by selecting File > Load >
Preference File.

9.

Select Register and then browse for the file new_curve_defaults.mvw.


This automatically loads new_curve_defaults.mvw file as the preference file.

10. Select new_curve_defaults.mvw from the list and click Load. Then click the red X in the
upper right corner to close the window.
11. If prompted to Update all plots current default colors, select No.
12. Click on the second plot window on this page.
13. Click Build Plots from the plotting toolbar.

Altair Engineering

HyperGraph 2D 13.0 Tutorials 103


Proprietary Information of Altair Engineering

14. Click Apply.


The color and line styles follow the defaults defined in the new_curve_defaults.mvw file
instead of the program system defaults.

Step 5: To set the default plot colors:


1.

Add a new page and select the TextView window mode.

2.

Open the document <install_directory>/tutorials/mv_hv_hg/preferences/


plot_colors.mvw from the File menu.

3.

After the *BeginPlotDefaults() line, add the following preference statements to set the
default plot colors:
*SetBackgroundColor(9)
*SetGridlineColor(6)
*SetZerolineColor(2)
*SetFrameColor(7)
*SetAxisColor(4)
*SetHeaderColor(0)
*SetFooterColor(3)

4.

Save the new preference file as new_plot_colors.mvw in your working directory. You cannot
save files back to the default directory.

104 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 6: To observe the updated default plot colors:


1.

Click Add Page on the toolbar to add a new page to the current session.

2.

Select HyperGraph 2D from the Select Application menu.

3.

Create header and footer text.

4.

Register and Load the preference file new_plot_colors.mvw. If prompted to "Update all
plots current default colors", click No.

5.

Add a new page, which will activate the new settings.

6.

Create header and footer text.


Note: The colors of the various areas of the plot window reflect the defaults defined in the
file new_plot_color.mvw rather than the program system defaults.

Step 7: To set the default fonts for the plot area:


1.

Add a new page and select the TextView window mode.

2.

Open the file <install_directory>/tutorials/mv_hv_hg/preferences/font_defaults.mvw


from the file browser on the toolbar.

3.

After the *BeginPlotDefaults() line, add the following preference statements:


*SetAxisLabelFont("Times New Roman", 1, 0, 8)
*SetAxisTicFont("Times New Roman", 0, 1, 18)
The first placeholder sets the font name.
The second placeholder sets the font weight. 0 = normal (default), 1 = bold.
The third placeholder sets the slant, or font style. 0 = normal (default), 1 = italic.
The fourth placeholder sets the font size, 8, 10, 12, 14, 18, or 24 points.
Note: If the suggested font is not available on your system, use the name of a font available
on your system.

4.

After the *SetAxisTicFont() line, add the following preference statements to set the font
defaults for the header and footer text:
*SetLine1HeaderFont("Verdana",0,0,8)
*SetLine2HeaderFont("Verdana",1,0,10)
*SetLine3HeaderFont("Verdana",0,1,12)
*SetLine1FooterFont("Tahoma",0,0,8)
*SetLine2FooterFont("Tahoma",0,1,10)
*SetLine3FooterFont("Tahoma",1,0,12)
Note: If the suggested font is not available on your system, use the name of a font available
on your system.

Altair Engineering

HyperGraph 2D 13.0 Tutorials 105


Proprietary Information of Altair Engineering

6.

Save the new preference file as new_font_defaults.mvw.

Step 8: To observe the updated default plot fonts:


1.

Click Add Page on the toolbar to add a new page to the current session.

2.

Select HyperGraph 2D from the Select Application menu.

3.

Create a three line header and footer on the plot.

4.

Register and Load the file new_font_defaults.mvw. If prompted to update to the current
defaults, select No.

5.

Change Page Layout to two windows per page.

6.

Click on the second plot window on the current page.

7.

Create a three line header and footer on the plot.


The fonts in the plot window reflect the defaults defined in the new_font_defaults.mvw file,
including each line of the header and footer area, rather than the program system defaults.

106 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 9: Set the note defaults.


1.

Add a new page and select the TextView window mode.

2.

Select the file <install_directory>/tutorials/mv_hv_hg/preferences/


notes_legends.mvw from the file browser on toolbar.

3.

After the *BeginPlotDefaults() line, add the following preference statement to set the
default font type, style and size for notes:
*SetNoteFont("Tahoma", 1, 1, 10)

4. After the *SetNoteFont() line, add the following preference statements to set the default for
note attachment, text alignment, and color:
*SetNoteAttachment(View)
*SetNoteAlignment(Left)
*SetNoteColor(5)
5.

Save the new preferences file as new_notes_legends.mvw.

Step 10: To set the legend defaults:


1.

Select the file new_notes_legends.mvw from the file browser in TextView window mode.

2.

After the *SetNoteColor() line, add the following preference statements to set the defaults
for legend font and legend placement:
*SetLegendFont("Tahoma",1,1,24)
*SetLegendPlacement(TopRight)

3.

Save the new preference file as new_notes_legends.mvw.

Step 11: To observe the updated default plot fonts:


1.

Click Add Page on the toolbar to add a new page to the current session.

2.

Select HyperGraph 2D from the Select Application menu.

3.

Change page layout to two windows per page.

4.

Add a curve to the current plot.

5.

Add a note to the current plot.

6.

Register and Load the file new_notes_legends.mvw. If prompted to update to current


defaults, select No.

7.

Click on the second plot window on the current page.

8.

Add a curve to the current plot.

Altair Engineering

HyperGraph 2D 13.0 Tutorials 107


Proprietary Information of Altair Engineering

9.

Add a note to the current plot.


The note and legend displayed on the plot reflect the defaults defined in the
new_notes_legends.mvw file. To view the note attachment update, translate the curves
using the view control arrows located in the lower left of the program window.

Step 12: Update note and legend defaults.


1.

Add a page and select TextView from the Select Application menu.

2.

Open file <install_directory>/tutorials/mv_hv_hg/preferences/headers_footers.mvw


from the file browser on the toolbar.

3.

After the *BeginDefaults() line, add the following preference statements to define the
*BeginHeader() block:
*BeginHeader()
*EndHeader()

4.

After the *BeginHeader() line, add the following preference statements to define portion of
the available header area:
*BeginRegion(400, 0, 600, 300)
*EndRegion()

5.

Region descriptions use a coordinate system. The arguments in the region statement
represent: the minimum X coordinate, the minimum Y coordinate, the maximum X coordinate
and the maximum Y coordinate.
If the region you were describing was the entire header area your *BeginRegion statement
would be: *BeginRegion(0,0,1000,1000).

6.

After the *BeginRegion() line, add the following preference statements to set the text font,
alignment and border for the region (update the path below to reflect where your installation is
located):
*Font("Times",0,1,12)
*Alignment(Center)
*BorderWidth(1,1,1,1)

7.

After the *BorderWidth() line, add the following preference statement to define the text in
the header region:
*Text("Project Title")

8.

Save the new preference file as new_headers_footers.mvw.

108 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering

Step 13: Add a page footer.


1.

Your file should be new_headers_footers.mvw. If not, open the file


new_headers_footers.mvw from TextView window mode.

2.

After the *EndHeader() line, add the following preference statements to define the
*BeginFooter() block:
*BeginFooter()
*EndFooter()

3.

After the *BeginFooter() line, add the following preference statements to define and set up
one region in the footer:
*BeginRegion(700, 0, 1000, 1000)
*Font("Times",0,1,12)
*Alignment(Center)
*BorderWidth(1,1,1,1)
*EndRegion()
The footer regions coordinate system is similar to the header region: minimum X coordinate is
0 at the left and maximum X coordinate is 1000 at the right. The minimum Y coordinate is 0 at
the base of the footer and its maximum coordinate is 1000.

4.

After the *BorderWidth() line, add the following preference statement to place text in the
region:
*Text("Your Name")
*Text("{time()} on {date()}")
*Text("Page:

5.

{pagenum}/{numpages}")

After the *EndRegion() line, add the following preference statements to define and set up a
second region within the page footer:
*BeginRegion(700, 0, 1000, 1000)
*BorderWidth(1,1,1,1)
*EndRegion()

6.

After the *BorderWidth() line, add the following preference statement to put an image in the
region:
*Image("<install_directory>/tutorials/mv_hv_hg/preferences/Altair_logo.gif")
Images, such as company logos, can be added to any region within the header or footer of a
plot. The image type must be either GIF (format 87), JPG or BMP. Images are fitted vertically
and centered horizontally.

7.

Save the new preference file as new_headers_footers.mvw.

Altair Engineering

HyperGraph 2D 13.0 Tutorials 109


Proprietary Information of Altair Engineering

Step 14: To observe the new page header and footer:


1.

Register and Load the preference file new_headers_footers.mvw.

2.

If a printer is installed, you can select Print and then click OK. These headers and footers will
be seen when the session or page is printed.

Step 15: To set the text editor defaults:


1.

Add a page and select TextView from the Select Application menu.

2.

Select the file <install_directory>/tutorials/mv_hv_hg/preferences/text_editor.mvw


from file browser on the toolbar.

3.

After the *BeginTextEditorDefaults() line, add the following preference statement to set
the default font type, style, and size for the text editor:
*Font("Times", 0, 1, 12)

4.

After the *Font() line, add the following preference statement to set the default text color
for the text editor window:
*TextColor(6)

5.

After the *TextColor() line, add the following preference statement to set the default
background color for the text editor window:
*BackGroundColor(23)

6.

Save the new preference file as new_text_editor.mvw.

Step 16: To observe the updated default plot fonts:


1.

Register and Load the file new_text_editor.mvw.

2.

Click the Add Page icon on the toolbar to add a new page to the current session.
The updated default for the background color is displayed

3.

Click in the text window and enter text to view changes to text defaults.

110 HyperGraph 2D 13.0 Tutorials


Proprietary Information of Altair Engineering

Altair Engineering