Chapter 16: External Graphics

Go to the Next Chapter
Go to the Previous Chapter
Go to the Table of Contents for This Manual
Go to the Guides Master Index

Chapter 1 * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6 * Chapter 7 * Chapter 8 * Chapter 9 * Chapter 10 * Chapter 11 * Chapter 12 * Chapter 13 * Chapter 14 * Chapter 15 * Chapter 16 * Chapter 17 * Chapter 18 * Chapter 19


16.1 External Graphics Overview

Other chapters in this document discuss how to create and control graphics that you view directly in the ANSYS program. While in ANSYS, you can export the contents of the graphics window (full screen options are also available for some platforms), either to a printer or to a graphics file.

You can also generate a neutral graphics file (*.GRPH) and use the stand-alone DISPLAY program. The DISPLAY program can be used to view static or animated screen images, or to convert your file into the appropriate format for printing, plotting, or exporting to word processing or desktop publishing programs.

16.1.1 Printing Graphics in Windows

In ANSYS, you can obtain hard-copy output by choosing Utility Menu> PlotCtrls>Hard Copy. You then choose to print the contents of the graphics window, or to create an exportable graphics file. When the To Printer option is selected, the Windows printer dialog box for the designated printer is displayed. Printing options, including page layout, output resolution and document handling can be modified at this stage.

Printer spooling options will free up the processor more quickly (especially in Z-buffered mode). In Type 4 or Polygon mode, spooling may cause some elements to not plot, or to be improperly placed. Select the Print Directly to Printer option when these types of printing problems are encountered.

16.1.2 Exporting Graphics in Windows

Selecting Utility Menu>PlotCtrls>Hard Copy and then the To File option displays the Graphics Hard Copy dialog box. This box provides a number of file export formats (BMP, EPS, TIFF) along with limited page layout and configuration options.

You can export Windows Metafiles directly from ANSYS (Windows systems only) by selecting Utility Menu>PlotCtrls>Write Metafile. The subsequent dialog boxes provide limited page layout and configuration options.

16.1.3 Printing Graphics in Unix

You can print to a post script printer from within ANSYS. Selecting Utility Menu>PlotCtrls>Hard Copy displays the PS Hard Copy dialog box. Print options, including page layout, reverse video and grey scale are available from this dialog box.

The Reverse Video option affects only the background of the display. The black background provided in the ANSYS graphics window is often unsuitable for printing. Selecting Reverse Video will present the graphics on a white background. Contour colors and other colors selected from the ANSYS palette are unaffected by this option.

16.1.4 Exporting Graphics in Unix

The PS Hard Copy dialog box also provides a number of file export formats (BMP, EPS, TIFF) along with limited page layout options. These files can be used in various word processing and desktop publishing applications.

To obtain other export formats, choose Utility Menu>PlotCtrls>Redirect Plots.. You can select from GRPH, PSCR, HPGL, HPGL2 and VRML. These formats are suitable for a wide range of applications outside of the ANSYS program. Of special interest is the .GRPH file, a neutral graphics file that uses the ANSYS plotting instructions to recreate the file in applications other than ANSYS.

16.2 Creating a Neutral Graphics File

The key to external graphics is the neutral graphics file. This is an ASCII text file containing the instructions required to produce a graphics display. You can view the displays stored on this file, using the DISPLAY program and the appropriate 2-D graphics driver, on any supported hardware platform. The neutral graphics file is not a bitmap format but an ASCII text format, which means the resolution of a display produced by the DISPLAY program usually will be better than that produced using the Utility Menu>PlotCtrls>Hard Copy.

To route your graphics displays to a neutral graphics file having any valid filename, use one of the choices shown below. (In batch mode, by default, the ANSYS program will assign this filename to Jobname.GRPH.)

Command(s):

GUI:

Utility Menu>PlotCtrls>Device Options
Utility Menu>PlotCtrls>Redirect Plots>To GRPH File
Utility Menu>PlotCtrls>Redirect Plots>To Screen

Each subsequent graphics action command that you issue writes a separate display to this file. (Thus, a neutral graphics file can contain more than one display, with each display being sequentially numbered, beginning with 1.) You can use the ANSYS animation macros, which automatically generate a series of graphics action commands for animation purposes, to create multiple displays on your neutral graphics file. If you wish, you can reissue the /SHOW command with a graphics device name to direct subsequent displays to your terminal screen. This way, you can toggle back and forth between the screen and a file (which is appended, not overwritten) as many times as you wish.

16.3 Viewing and Translating Neutral Graphics Files with the DISPLAY Program

Once you have created a neutral graphics file, you can use the stand-alone DISPLAY program to view static or animated screen images, or to translate your file into the appropriate format for printing, plotting, or exporting to word processing and desktop publishing programs. The DISPLAY program creates images directly by using information from a .GRPH file created in a previous ANSYS session.

DISPLAY supports all UNIX screen devices and printers that the ANSYS program supports. It also supports Windows-compatible screen devices and printers and the following hard copy formats:

16.3.1 Getting Started with the DISPLAY Program

The DISPLAY program runs independently from the ANSYS program. You can enter the DISPLAY program via the launcher or a command. From the ANSYS launcher on UNIX, choose DISPLAY Utility. From Windows, click on the Start button and choose Programs>ANSYS 5.5>Display Utility. From a UNIX prompt, issue the command display5x. You can specify any or all of the following commands options:

-j

Jobname

-d

Device_Type

-s

Read / Noread

These options function exactly as they do in the ANSYS program. The DISPLAY program does not support the memory (-m), database (-db), batch (-b), ANSYS menu (-g), language (-l), product (-p), version (-v), and parameter specification options.

DISPLAY does support the redirection of standard input and output. For example, in the C (csh) shell, the following statement is valid:

display55  -d  X11  -j  demo  <demo.dat>&  demo.out  &
To streamline your use of the DISPLAY program during presentations and demonstrations, you might want to create a START5x.DSP file (where 5x indicates the release number, such as 55 for Release 5.5) containing any valid DISPLAY commands that you would want to execute automatically at start-up. (Use an external text editor to create START5x.DSP.)

The ANSYS program reads the first START5x.DSP file it finds in the following search paths:

If you are running DISPLAY on a Windows System, instead of using a START5x.DSP file, you can simply select a file.GRPH file from File Manager, drag it to the DISPLAY window, and drop it there.

16.3.2 Viewing Static Images on a Terminal Screen

Use the following procedure to view static displays on a screen with the DISPLAY program.

Note-The commands discussed in this section, unless otherwise noted, are DISPLAY commands, not ANSYS commands.

1. Set up your DISPLAY session with the /SHOWDISP and (if desired) /CMAP or NOCOLOR commands. (You can include these commands in a START5x.DSP file.)

2. Using the FILEDISP command, direct the DISPLAY program to read the desired neutral graphics file. If you are using the DISPLAY and ANSYS programs simultaneously, make sure the neutral graphics file is first closed in ANSYS. That is, issue /SHOW,TERM before reading the file in DISPLAY.

3. Specify terminal options with the TERM command. For screen display, you might be interested in setting the TERM,LOOP options (the number of loops, NLOOP, and the amount of time to pause between displays, PAUSE).

4. Issue the PLOT command to cause specified displays to be formed. Recall that your graphics file can contain several different displays. You can call up specific displays by number, or you can instruct the program to display ALL plots found on your file.

5. Issue FINISH to exit the DISPLAY program.

16.3.3 Viewing Animated Sequences on a Screen

The procedure for creating an animated display in the DISPLAY program is similar to that used in the ANSYS program. By executing /SEG and ANIM commands, you can display several frames in rapid succession to achieve an "animation" effect. (As in the ANSYS program, with the DISPLAY program you cannot use all hardware platforms to produce online animation.)

GUI menu paths to the /SEG and ANIM commands are:

GUI:

Utility Menu>PlotCtrls>Redirect Plots>Delete Segments
Utility Menu>PlotCtrls>Redirect Plots>Segment Status
Utility Menu>PlotCtrls>Redirect Plots>To Segment Memory
(UNIX)
Utility Menu>PlotCtrls>Redirect Plots>To Animation File (Windows)

The same comments regarding memory requirements for ANSYS animation also apply for the DISPLAY program. A typical command stream for animation would look like this:

/SEG,DELE	! Deletes all currently stored segments
/SEG,MULTI	! Stores subsequent displays in segment memory
PLOT,4,8,1  	! Plots #4 - #8 (5 frames total) are stored in segment 
		!     memory  (Use PLOT,ALL to include every plot)
/SEG,OFF       	! Turn off the frame-capture function
ANIM,10	! Cycles through the five frames 10 times

16.3.4 Capturing Animated Sequences Off-Line

You can use the DISPLAY program to capture animation off-line (on film or videotape) in much the same way as you would do for the ANSYS program. See Chapter 15 for a general discussion of this technique.

16.3.5 Exporting Files to Desktop Publishing or Word Processing Programs

You can use the DISPLAY program to translate ANSYS graphics files into Hewlett Packard Graphics Language (HPGL), Encapsulated PostScript (EPS), or some other external format, for possible use in outside desktop publishing and word processing programs. The Window's version of DISPLAY is also capable of exporting Metafile Graphics (WMF or EMF), in addition to the formats listed above. See your program's documentation for the particular format requirements.

16.3.5.1 Exporting Files on a UNIX System

To create such exportable graphics files, perform these tasks:

1. Using the DISPLAY program, issue the FILEDISP command to direct the program to read the desired filename. With the /SHOWDISP command, identify which graphics format you desire (HPGL, POSTSCRIPT, INTERLEAF, etc.). The HPGL format includes color HPGL capability, and the POSTSCRIPT format includes Encapsulated Postscript by default.

2. Still in the DISPLAY program, create one plot per file by typing PLOT,1, PLOT,2, ... etc. (or PLOT,ALL). The DISPLAY program will automatically assign an output filename.

3. Exit the DISPLAY program (using the FINISH command) and enter the word processing program. Create a graphics box in the document at the size of your choice. (Square boxes are recommended to avoid clipping the ANSYS image.)

4. Identify the appropriate file (for instance, PSCRnn.GRPH, HPGLnn.GRPH, etc.) and retrieve the image into the box. HPGL files will produce a screen image (bitmapped). You also can set up an EPS file to include a TIFF (Tagged Image File Format) bitmap or an Encapsulated PostScript Interchange Format (EPSI) bitmap for screen previewing. To do so, use the PSCR,TIFF and PSCR,EPSI command options within the DISPLAY program.

16.3.5.2 Exporting Files on a Windows System

The Windows version of DISPLAY provides direct METAFILE graphics export, in addition to the formats listed above. The system must be running in 32 bit mode (Windows 95 or NT, running win32 or win32C). If the system is operating in Z-buffered mode, it will automatically switch to polygon mode when the file export is requested. A Windows metafile is created and saved in the specified directory by performing the following tasks:

1. From the FILE menu, select Export Ansys Graphics.

2. Select Metafile.

3. To invert the colors of the graphic, choose the Controls option. The Standard Color option exports the ANSYS display file with a black background and the colors designated in the ANSYS program. The Invert WHITE/BLACK option will provide a white background, but still retain the original colors. Choose OK to continue.

4. Select the name, location and type of metafile to be exported. The option for WMF or EMF is provided. Each file export is assigned the default filename file00.emf (or wmf), with the "00" field incrementing for each subsequent file export. Older Windows products do not support EMF files.

Windows Metafiles can be exported directly from ANSYS (Windows systems only) by selecting Utility Menu>PlotCtrls>Write Metafile. The subsequent dialog boxes provide the same options listed above.

Windows Metafiles cannot be obtained directly from the UNIX platform (ANSYS or DISPLAY). The DISPLAY utility for Windows must be installed, and the ANSYS graphics files must be exported to the Windows file system in order to be converted. DISPLAY for Windows is shipped with all ANSYS products. Contact your ASD for installation instructions.

16.4 Obtaining Hard-Copy Plots

The DISPLAY program can generate hard copy through a number of external printer and plotter drivers, or by means of built-in terminal hard-copy capability.

16.4.1 Activating the Hard-Copy Capability of Your Terminal on UNIX Systems

If your terminal has built-in hard-copy capability, you can execute /PCOPY (for HP work stations only) or TERM,COPY,NCOPY (in the DISPLAY program) to activate it. This option is available only during interactive sessions, with the /SHOWDISP specification active for terminals having hard copy capability.

16.4.2 Obtaining Hard Copy on External Devices Using the DISPLAY Program

The DISPLAY program supports a variety of printers and plotters via the HPGL, INTERLEAF, and POSTSCRIPT graphics drivers. To activate one of these drivers, first issue the appropriate /SHOWDISP command (such as /SHOWDISP,HPGL), and then set various driver options (using the HPGL, or PSCR commands, as appropriate). If you are using a pen plotter, the TRANS command will read the current neutral graphics file and will create a compressed and more efficient version of the file. Do not apply TRANS to files containing raster-mode hidden line displays, although TRANS will not adversely affect vector-mode hidden line displays.) Subsequent PLOT commands will create graphics files formatted for the desired device.

16.4.3 Printing Graphics Displays on a Windows-Supported Printer

To produce hard copy versions of ANSYS graphics displays, use the ANSYS HardCopy menu and the Print menu in the DISPLAY program.

When you are printing to a local (not shared) printer, follow these steps:

1. Activate the Print Manager.

2. Select the Properties Menu for the desired printer.

3. Select the Details Menu.

4. Select the option Print directly to ports.


Go to the beginning of this chapter