4.2. Neutral Graphics File Format

The neutral graphics file is an 80-byte, ASCII coded file with fixed length records. It contains plot directives representing the image of a display, as formed in ANSYS, encoded onto a host-independent, printable character set.

Most ANSYS users will not need to know the format of the graphics file. However, in rare cases, you may want to edit your graphics file or, as a programmer, you may need to know the file format to write a program that reads it. Although the file is ASCII coded, it can be difficult to interpret. This section gives details about the file format.

4.2.1. Characters the Graphics File Uses

The host-independent printable character set consists of the ASCII characters listed below:

  • Numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9

  • Uppercase alphabetic characters A through Z

  • The following characters: $ ( ) * + , - . < = >

  • The space character, " ".

4.2.2. Graphics File Directives

Graphics files contain a set of directives that define various aspects of how ANSYS displays a plot, such as window coordinates, colors for graphs and test, line dimensions, and so on. Each directive consists of a command character followed by one or more parameters.

Within a graphics file, one directive directly follows the preceding directive. For example, below is the first line of a graphics file:

(BBAAA2A0AAAAAAPPPLPO>AP$MEKLKBAJANSYS 5.3$MEKLEFALNOV 15 1996$MEKKOJAI10:01:40

The text of this example line breaks down as follows:

(BBAAA
The Start-Plot directive, beginning with command character. (B, B, A, A, and A are the values of parameters defining the plot environment. (Parameters for all plot directives, and their possible values, are explained later.)
2A
The Text-Size directive, which determines the type size of displayed text strings. The 2 is the command character, and A represents the size value.
0AAAAAAPPPLPO
The Window directive, which sets the coordinates for the displayed image. 0 is the command character. AAAAAA represents the first set of coordinates (the lower left corner of the image), and PPPLPO represents the second coordinate set (the right upper corner of the image).
>AP
The Text-Color directive, which sets the color of displayed text. > is the command character. AP is a parameter value specifying the color.
$MEKLKBAJANSYS 5.3
The first of several Text directives. $ is the command character, MEKLKB are the coordinates for the text, AJ is the number of characters in the string, and ANSYS 5.3 is the text string itself.
$MEKLEFALNOV 15 1996
A second Text directive, defining the position and length of the string NOV 15 1996.
$MEKKOJAI10:01:40
A third Text directive, defining the position and length of the string 10:01:40

4.2.2.1. Parameter Types for Graphics File Directives

The descriptions of graphics file directives in the next section include discussions of the parameter or parameters for each directive. There are five types of parameters:

Parameter TypeParameter AttributesValid Parameter Values
Int1 byte, base 16 (letters A through P)0 through 15
Long2 bytes, base 16 (letters A through P)0 through 255
Byt33 bytes, base 16 (letters A through P)0 through 65535
Xy6 bytes, base 16 (letters A through P)0 through 4095, mapped to coordinate space of -1.0 to 1.67
StringAn array of Nchar charactersCharacters from the common character set.

4.2.2.2. Directive Descriptions

The next few pages describe each of the graphics file directives. Parameters are always specified in the order shown below.

Graphics DirectiveCommand CharacterParametersParameter Types
Start_Plot(

keras - Defines whether the display surface is cleared prior to the plot (0 = do not clear the surface, 1 = clear it)

kras - Defines whether the display uses raster mode or vector mode (1 = raster mode, 0 = vector mode)

kcntr - Defines whether the display uses a contour color map or shading color map (1 = contour, 0 = shading)

kdocu - Defines whether the Docu column is compressed (1 = do not compress, 0 = compress)

ispare - A spare value

Int, Int, Int, Int, Int
Window0x1,y1, x2,y2 (x and y coordinates)Xy, Xy
Area-Color<iclra - Sets the color for the displayed area. (See "Color Specification" below.)Long
Graph-Color=iclrg - Sets the color for the displayed graph. (See "Color Specification" below.)Long
Text-Color>iclrt - Sets the color for displayed text. (See "Color Specification" below.)Long
Text-Size2tsize - Defines the size of displayed text (0 = normal, 1 = small)Int
Line-Type,ltype - Defines the type of lines used in the display (0 = solid, 1 = dashed)Int
Line-Width1lwidth - Defines the width of displayed lines (0 = normal, 1 to 5 = larger line size)Int
Marker Size3size - Defines the size of the node marker (0 = the smallest size, 15 = the largest size)int
Anno Size4Annotation text size * 1000 Long
Pixmap Style5= 1 - Do not include background pixelsInt
Font Control6= 1 - Small fontInt
Text Justification7

= 0 - Right justified

= 1 - Left justified

Int
Point*x,y - Defines a point at coordinates x,yXy
Move.x,y - Moves to coordinates x,yXy
Draw-x,y - Draws a line to coordinates x,yXy
Text$

x,y - Sets coordinates for where text will display

nchar - Defines the number of displayed characters

string - Defines the text string itself

Xy, Long, String
Normal/inorm - This value, divided by 255, is cos(), where is the viewing direction and the surface normal of subsequent polygonsLong
Polygon+

n - Defines the number of polygon vertices

kedge - Defines whether the polygon edge is displayed (0, = do not display edge, 1 = display it)

xy1,...xyn - Defines coordinates for the polygon

Int, Int, Xy...Xy
No-Opnoneno parametersnone
End-Plot)no parametersnone
PixmapZ

kpx - Defines the pixel resolution

x1,y1 - Sets coordinates for the lower left corner of the z-buffer image

x2,y2 - Sets coordinates for the upper right corner of the z-buffer image

The following three parameters are run-length encoded data which repeats until all pixels are read in, as defined by the window (X2-X1 + 1) * (Y2-Y1 + 1)

n - Defines the number of pixels in a row

inrm - Sets the normal for pixels

iclr - Sets the color for the pixmap

Byt3, Xy, Xy, Long, Long, Long, ...

4.2.2.3. Color Specification

Below is the list of color specifications used by the directives that set colors for areas, graphs, and text. If more than a single intensity of a color is available, use the value specified by the Normal directive to complete the selection. Normal of 0 represents the lowest intensity and normal of 255 represents the highest intensity.

ValueColor
0Black
1Cyan
2Blue-Magenta
3Red
4Cyan-Blue
5Magenta-Red
6Green
7Orange
8Magenta
9Yellow-Green
10Blue
11Green-Cyan
12Yellow
13Dark Gray
14Light Gray
15White
16 
:Reserved for future use
127 
128Blue
::
 Cyan
 :
 Green
 :
 Indices 128 through 255 represent the color spectrum used to display the Low (Blue) to High (Red) contour values.
 :
 Yellow
 :
 Orange
::
255Red

Release 18.2 - © ANSYS, Inc. All rights reserved.