Skip to content

Document Property Reference

The following are the properties for the Data Table document created by :

data [any] Data contained in the table

vlegend [any] Data contained in vertical legend

hlegend [any] Data contained in horizontal legend

dformat (int) Number Format for Data of table, specified by combining Number Format Constants

vformat (int) Number Format for Vertical Legend of the table, specified by combining Number Format Constants

hformat (int) Number Format for Horizontal Legend of the table, specified by combining Number Format Constants

cellwidth (real) Width of each cell in the table, specified in number of characters (uses average character width for specified font)

legendwidth (real) Width of the vertical legend, specified in number of characters (uses average character width for specified font)

Example:

var x=insertdatasheet("Stock Prices");
document[x].data=[[34.5,33.6,35.1],[80.1,85.2,85.9]];
document[x].vlegend=[2004,2005,2006];
document[x].hlegend=["Stock 1","Stock 2"];
document[x].dformat=FMT_D2+FMT_FIX+FMT_DLR;
document[x].vformat=FMT_D0;
document[x].hformat=0;
document[x].cellwidth=30;
document[x].legendwidth=20;

Diagram Properties

There are currently no properties that can be modified programmatically for Diagram documents. However, new Diagram documents can still be created by insertdiagramsheet

Graph Properties

The following are the properties for the Graph document, created by insertgraphsheet

data (exe)->[real] Y-data points contained in the graph, represented as evaluatable text (e.g., a node name). Can contain up to 4 sets of data points

x (exe)->[real] X-data points, represented as evaluatable text (e.g., a node name)

style1 (int) Style for the first set of data. Specified by combining Graph Style Constants. Contains both the Global Graph Style for the graph and the Individual Trace Style for the first set of data.

style2 (int) Style for the second set of data. Specified by combining Graph Style Constants. Contains the Individual Trace Styles for the second set of data. Note that any Global Graph Styles are ignored.

style3 (int) Style for the third set of data. Specified by combining Graph Style Constants. Contains the Individual Trace Styles for the third set of data. Note that any Global Graph Styles are ignored.

style4 (int) Style for the fourth set of data. Specified by combining Graph Style Constants. Contains the Individual Trace Styles for the fourth set of data. Note that any Global Graph Styles are ignored.

title (text) Title of the graph

xlabel (text) Label of the x-axis

ylabel (text) Label of the y-axis

legend (exe)->[text] Label for each y-data set, represented as executable text (e.g., a node name)

analysis (int) Analysis type. This is an integer that represents the value selected in the Data Filter list box on the Analysis tab of Graph Properties

param1 (real) First Parameter value for the Analysis specified by the analysis property

param2 (real) Second Parameter value for the Analysis specified by the analysis property

param3 (real) Third Parameter value for the Analysis specified by the analysis property

param4 (real) Fourth Parameter value for the Analysis specified by the analysis property

formula (bool) True to show the formula on the graph, False to not show the formula

extent (real) Value to which to extend the trend of the graph. This value is only used if useextent is True

useextent (bool) True to extend the trend of the graph (to value specified in extent), False to not extend trend

yformat (int) Number format for y-axis data, specified by combining Number Format Constants

xformat (int) Number format for x-axis data, specified by combining Number Format Constants

x1 (real) X-axis lower limit, only used if GS_LIMITX1 graph style is used

x2 (real) X-axis upper limit, only used if GS_LIMITX2 graph style is used

y1 (real) Y-axis lower limit, only used if GS_LIMITY1 graph style is used

y2 (real) Y-axis upper limit, only used if GS_LIMITY2 graph style is used

Example:

var x=insertgraph("Product Sales");
document[x].data="Sales";
document[x].x="Months";
document[x].style1=GS_BAR+GS_AXES+GS_COLOR+GS_LIMITY1;
document[x].style2=GS_BAR;
document[x].title="Sales";
document[x].xlabel="Year";
document[x].ylabel="Millions";
document[x].legend="['ABC','XYZ']";
document[x].yformat=FMT_D0+FMT_DLR;
document[x].y1=0;
Sales:=[[3,7,12,15],[9,10,10,12]];
Months:=[1,2,3,4];

Note: The example code above will only work if inside parenthesis rather then braces so it executes at the model namespace.

Surface Plot Properties

The following are the properties for the Surface Plot document, created by: insertgraphsheet

The following are the properties for the Surface Plot document, created by:

data (exe)->[real] Z-axis values, represented as executable text (e.g., a node name)

x (exe)->[real] X-axis values, represented as executable text (e.g., a node name)

y (exe)->[real] Y-axis values, represented as executable text (e.g., a node name)

style (int) Graph Style, specified by combining Graph Style Constants

title (text) Title for the graph

xlabel (text) X-axis label

ylabel (text) Y-axis label

zlabel (text) Z-axis label

contours (int) Number of contours to draw on the graph. Setting this value to 0 will cause the graph to automatically select a reasonable number of contours

xformat (int) Number format for the x-axis labels, specified by combining Number Format Constants

yformat (int) Number format for the y-axis labels, specified by combining Number Format Constants

dformat (int) Number format for the z-axis labels, specified by combining Number Format Constants

Example:

var x=insertgraph3("Sales Grid");
document[x].data="SalesData";
document[x].x="SalesX";
document[x].y="SalesY";
document[x].style=G3_DEFSTYLE;
document[x].title="Title";
document[x].xlabel="x";
document[x].ylabel="y";
document[x].zlabel="Millions";
document[x].dformat=FMT_D0+FMT_DLR;
SalesData:=[[10,18,20],[30,52,40],[25,30,25]];
SalesX:=[1,2];
SalesY:=[1,2];

Note: The example code above will only work if inside parenthesis rather then braces so it executes at the model namespace.

Report Properties

The following are the properties for the Report document, created by :

text (text) Text of the sheet

rtf (text) RTF (rich text format) version of the sheet (which can include text formatting)

html (text) HTML version of the sheet. This property is read-only.

editmode (bool) TRUE to make the report editable, FALSE to display calculated values (as read-only)

Example:

var x=insertreportsheet("Sales Report");
document[x].text="\
  Sales Report
  Sales (in millions) were: <%Sales%>";

Presentation Table Properties

The following are the properties for the Presentation Table document, created by :

data (exe)->[real] Data to display, represented as executable text (e.g., a node name)

vlegend (exe)->[real] Values for vertical legend, represented as executable text (e.g., a node name)

hlegend (exe)->[real] Values for horizontal legend, represented as executable text (e.g., a node name)

style (int) Table style, specified by combining Table Style Constants

title (text) Title of the table

vlabel (text) Vertical label of the table

hlabel (text) Horizontal label of the table

tbmargin (real) Top and bottom margins within each cell in units of a character height

lrmargin (real) Left and right margin within each cell in units of an average character width

dformat (int) Number format for table data, specified by combining Number Format Constants

vformat (int) Number format for vertical legend, specified by combining Number Format Constants

hformat (int) Number format for horizontal legend, specified by combining Number Format Constants

Example:

var x=inserttable("My Table");
document[x].data="Sales Data";
document[x].hlegend="Sales Products";
document[x].style=TS_DEFSTYLE;
document[x].title="Product Sales";
document[x].vlabel="Year";
document[x].hlabel="Product";
document[x].dformat=FMT_D0+FMT_DLR;
Sales Data:=[[3,7,12,15],[9,10,10,12]];
Sales Products:=["ABC","XYZ"];

Note: The example code above will only work if inside parenthesis rather then braces so it executes at the model namespace.

Text Sheet Properties

The following are the properties for the Text Sheet document, created by :

text (text) Text of the sheet

rtf (text) RTF (rich text format) version of the sheet (which can include text formatting)

html (text) HTML version of the sheet. This property is read-only.

Example:

var x=inserttextsheet("Instructions");
document[x].text="This is a model for forecasting sales for the next few quarters";

Tree Sheet Properties

The following are the properties for the Tree Sheet document, created by :

rootnode (text) Name of the root node of the sheet

pageroot (text) Name of the paged node (i.e. different from the rootnode if the user is paged into a branch) of the sheet

changenodetype (method) In Decision Tree analysis, calling this property toggles the selected node between a Decision Node and an Event Node.

style (int) Tree Style, specified by combining Tree Style Constants

title (text) Title of the tree sheet

Example:

var x=inserttreesheet("ROE Model");
document[x].rootnode="ROE";
ROE:=Profit/Equity;
Profit:=PBT-Tax;
PBT:=100000;
Tax:=PBT*34%;
Equity:=Assets-Liabilities;
Assets:=700000;
Liabilities:=250000;

Note: The example code above will only work if inside parenthesis rather then braces so it executes at the model namespace.

Node Properties

The following are the properties of Nodes:

note (text) The comment for the node

form (text) The node's dialog form, or null if there is no form

nodeformat (int) Specifies the node's format, including maximum node length. This property is specified by combining Node Format Constants, and optionally adding the value for Maximum Node Length (1-255).

valueformat (int) Number format for the node, specified by combining Number Format Constants

color (int) Color of the node (RGB hex format). The RGB function can assist in translating RGB intensity values to hex format.

showformat (int) Show format for the node, specified by combining Node Show Format Constants

group (int) If non-zero, defines the ID of the group that contains this node

groupchild (int) If non-zero, this is a group node and this value defines the ID that nodes in this group will have in their group property.

value (any) Value of the node

reductionunit (bool) True if the node defines a reduction unit

execnamespace (int) Name of the execution namespace (where this node will execute)

homenamespace (int) Name of the home namespace (where this node is defined)

minargs (text) The minimum number of arguments (+ 1 for the function name itself) accepted by the node. This property is read-only.

maxargs (text) The maximum number of arguments (+ 1 for the function name itself) accepted by the node. This property is read-only.

definition (text) System definition for the node. This property is read-only.

Example:

each(document[x].valueformat=FMT_SEP+FMT_DLR,x,
user(treelist("ROE")));
document.ROE.valueformat=FMT_PCT;
document.ROE.color=RGB(0,0,255);
document.ROE.note="Return on Equity";

Note: This example is based on the sheet/nodes created in the example for the Tree Sheet document (ROE). It is recommended you run that example to create the ROE sheet before running the example.