Skip to content

Format Constants Reference

This section lists the format constants used by the document properties discussed in this chapter. In general, styles and formats are specified by setting the appropriate format property to the combination of desired format constants. Format constants are defined as "bits" that, when combined, turn on or off style and format properties. Format constants can be combined using either the Add (+) operator or Bitwise Or (|) operator. For example, you can define the style for a graph using either:

document.Graph1.style1=GS_BAR+GS_GRID+GS_AXES;

or

document.Graph1.style1=GS_BAR|GS_GRID|GS_AXES;

When defining a complete style or format using these flags, in the example above, the two methods are equivalent. However, when modifying an existing style, you should always use the Bitwise Or and Bitwise And methods. For instance, if you want to change a graph to color mode, you should use the following method:

document.Graph1.style1=document.Graph1.style1|GS_COLOR;

Similarly, if you want to change a graph to grayscale mode (i.e. remove the GS_COLOR bit), you should use the following method:

document.Graph1.style1=document.Graph1.style1&~GS_COLOR;

Note: Use bitwise operators to modify existing styles because you will not always know if the style bit is already set. For example, if you use the Add operator intending to add the GS_COLOR style bit, but the GS_COLOR style bit is already on, the graph style will not be set correctly.

Number Format Constants

The following Number Format Constants can be used to specify the display format for numbers.

Decimals/Significant Digits (select only one):

FMT_D0 0 digits
FMT_D1 1 digits
FMT_D2 2 digits
FMT_D3 3 digits
FMT_D4 4 digits
FMT_D5 5 digits
FMT_D6 6 digits
FMT_D7 7 digits
FMT_D8 8 digits
FMT_D9 9 digits

Format (select only one):

FMT_FIX Fixed decimal
FMT_SIG Significant digits only
FMT_SCI Scientific notation
FMT_ENG Engineering notation

Style (may combine more than one):

FMT_ZER Suppress trailing zeros
FMT_PCT Percent
FMT_SEP 000s separator
FMT_DLR Currency symbol
FMT_PRN Parentheses on negative numbers
FMT_UNT Reduce compound units

Graph Style Constants

The following Graph Style Constants can be used to specify the style/type of graph. Global Graph Styles define global settings for the graph such as axis scales and drawing of grid. Individual Trace Styles specify the style for different sets/traces in the graph (i.e. one set could be shown as a Line Graph, one as Bar Graph, etc). Surface Plot Graph Styles define special styles that are only applicable to Surface Plot graphs. Composite Styles are styles that are a combination of other base styles.

Global Graph Styles

GS_LOGX Use a logarithmic x-axis scale; all x-values must be greater than zero
GS_LOGY Use a logarithmic y-axis scale; all y-values must be greater than zero
GS_ZERO Include zero in the y-axis. The y-axis range is normally selected automatically to include all y-values. This option forces zero to be included in the y-range.
GS_BOX Draw a bounding box around the graph. This and the GS_GRID style force axes to be placed at the left and bottom edges of the graph rather than in the graph interior.
GS_AXES Draw x- and y-axes. Same as GS_AXISX + GS_AXISY.
GS_AXISX Draw x-axis
GS_AXISY Draw y-axis
GS_GRID Draw a grid. Same as GS_GRIDX + GS_GRIDY. This and the GS_BOX style force axes to be placed at the left and bottom edges of the graph rather than in the graph interior.
GS_GRIDX Draw a grid in the x-direction
GS_GRIDY Draw a grid in the y-direction
GS_ASPECT Use the same scale factor to adjust both the x- and y-axes. Normally, axes are scaled to fit the window or page on which the graph is drawn. Selecting this style forces one unit in the x-direction to be exactly the same physical length as one unit in the y-direction.
GS_COLOR Use color to distinguish different traces on the graph. Normally, hatch patterns or dotted lines are used.
GS_AUTO Automatically reconstruct the graph if any nodes in the system change. Without this option, you can explicitly update a graph by clicking the Recalculate button.
GS_STACKED Stack successive data sets and plot the sums. The first trace is based on the y1-data set only. The second trace is based on the sum of the y1- and y2-sets; and so on. The final trace represents is the sum of all y-data sets.
GS_LIMITX1 Use x lower limit, as defined in x1 property of graph
GS_LIMITX2 Use x upper limit, as defined in x2 property of graph
GS_LIMITY1 Use y lower limit, as defined in y1 property of graph
GS_LIMITY2 Use y upper limit, as defined in y2 property of graph

Individual Trace Styles

GS_AREA Shade the area beneath a line graph
GS_LINE Connect points with a straight line
GS_POINT Plot the data points
GS_BAR Create a bar graph. With bar graphs, the x-axis is not drawn to scale, but instead, each x-point is allocated the same space across the x-axis.
GS_DELTA Draw a vertical arrows whose height represents magnitude in the y-direction
GS_VALUE Display the y-value above each point

Surface Plot Styles

GS_MESH Display a grid on the plotted surface corresponding to the mesh of sample points
GS_CONTOURFILL Shade the surface plot using colors or gray levels to represent different levels in the z-direction
GS_CONTOURLINES Draw contour lines at the border between discrete levels in the z-direction
GS_LEGEND Draw a legend relating the contour fill colors to levels in the z-direction
GS_XFIXED X-values are evenly spaced on the x-axis regardless of value
GS_CONTOUR Produce a flat contour graph without perspective and 3-D effects

Composite Graph Styles

GS_DEFSTYLE GS_LINE + GS_GRIDX + GS_GRIDY + GS_AXISX + GS_AXISY + GS_COLOR
G3_DEFSTYLE GS_CONTOURFILL + GS_LEGEND + GS_MESH + GS_BOX + GS_GRID + GS_AXES + GS_COLOR

Table Style Constants

The following Table Style Constants can be used to specify the display style of tables. Composite Table Styles are styles that are combinations of other base styles.

Table Style Constants

TS_VRULE Show vertical rules (lines) between columns
TS_HRULE Show horizontal rules (lines) between rows
TS_GRAY Gray background in legend column and row
TS_LEFT Left justify cell contents if set, right justify if not set
TS_UNIFORM Use uniform cell widths if set, smallest width possible for each column if not set
TS_LABEL Place vlabel above the first column as opposed to left of the entire table
TS_AUTO Automatically reconstruct the table if any nodes in the system change

Composite Table Styles

TS_DEFSTYLE TS_VRULE + TS_HRULE + TS_GRAY + TS_UNIFORM

Tree Style Constants

The following Tree Style Constants can be used to specify the display style of tree sheets.

Tree Style Constants

IDT_SHOWTREE Show the tree on the sheet
IDT_SHOWBRANCHES Show redundant branches
IDT_SHOWTABLE Show the Input/Output tables
IDT_SHADOW Show shadows behind nodes
IDT_COLORCODING Applies color-coding to reflect a node's value
IDT_VARIABLELENGTH Fit node length to its contents
IDT_AUTOCALC Automatically recalculate tree when a node's definition is changed
IDT_DECISIONFORMAT Show tree in Decision Tree format
IDT_SHOWDENODES Show "hot spots" at each end node, which allow user to double-click to quickly add a child node
IDT_HIGHLIGHTPATH Highlight the optimal/selected path in decision trees
IDT_DRAFTLAYOUT Show tree in draft layout
IDT_SHOWFULLNOTE Show full comment (multi-line) inside each node. If not selected, only first line of comment is shown.
IDT_LISTFORMAT Show tree in list format
IDT_PRINTLAYOUT Show tree in print format
IDT_DTREEFORMAT Show in Decision tree script format
IDT_SHOWPARTENTS Reverses the tree order from parent-child to child-parent

Node Format Constants

The following Node Format Constants can be used to specify the display format of nodes.

Node Format Constants

(Node Length) The first 8 bits of the node format styles are the node length / max length (e.g. 55+NFMT_LEFT+...). Node length can be from 0-255.
NFMT_SHOWCOMMENT Show comment in tree view
NFMT_SHOWNAME Show name in tree view
NFMT_SHOWDEFINITION Show definition in tree view
NFMT_SHOWVALUE Show calculated value in tree view
NFMT_INPUTFORMAT Make the node an input node
NFMT_OUPUTFORMAT Make the node an output node
NFMT_SHOWEQUATION Show the definition in equation format
NFMT_SHOWBORDER Show a border around the node
NFMT_BUTTONFORMAT Make the node a button
NFMT_LEFT Use left alignment for node contents
NFMT_CENTER Use center alignment for node contents
NFMT_RIGHT Use right alignment for node contents
NFMT_ISNOTE Make the node a Floating Text Box
NFMT_ISPICTURE Make the node a Picture
NFMT_NOSELECT Makes the node unselectable
NFMT_HOTSPOTFORMAT Make the node a hotspot
NFMT_FIXEDWIDTH Set node to use a fixed rather than variable length
NFMT_COMPONENT Node is defined as a component
NFMT_PRIMITIVEFORMAT Node will be moved to the primitive namespace when the model is loaded as a component
NFMT_EXPANDBRANCH Expand the branch of the tree in the list view
NFMT_HIDECHILDREN Hide all child nodes
NFMT_HIDENODE Hide a node
NFMT_PAGEBREAK Insert a page break in node contents

Node Show Format Constants

The following Node Show Format Constants can be used to specify the way that nodes and children nodes are displayed.

Node Show Format Constants

NSFT_PAGEBREAK Create a page break after this node
NSFT_HIDENODE Hide this node and all children
NSFT_HIDECHILDREN Hide children of the node
NSFT_EXPANDBRANCH Show all children of the node when the tree is in list format. Simulates clicking expand/collapse (±) in the tree