CreateLayout()
Summary
Creates a new layout window.
Syntax
CreateLayout(string layout_name, array options)
| Argument | Contents |
|---|---|
| layout_name | The desired name for the layout |
| Option | Type | Contents |
|---|---|---|
| Activate Macro | String | The name of a macro that is called whenever the window is activated |
| Annotation Menu | String | The context menu when clicking on an annotation and only one is selected |
| Annotations Menu | String | The context menu when clicking on an annotation and several are selected |
| Close Macro | String | The name of a macro that is called when the user closes the window from the system menu |
| Container | String | The context menu when clicking on a container |
| Context Menu | String | The default context menu when clicking on a layout, outside annotations |
| Cut Lines | Boolean | Whether to display page cut lines and page numbers on multiple page layouts; defaults to "True" |
| Done Macro | String | The name of a macro that is called after the window is closed |
| Framed Annotation Menu | String | The context menu when clicking on a framed annotation ("Maps", "Dataviews", or "Figures") |
| Grid Display | Boolean | Whether to display the grid. Defaults to "False" |
| Grid Settings | Array | {string unit, integer resolution divisor, integer minor interval, integer major interval}. See Notes, below |
| Grid Snap | Boolean | Whether to snap new annotations to the grid. Defaults to "False" |
| Menu | String | The menu that is associated with the window |
| Position | Array | The screen location of the window in an array of 2 integers {x, y} |
| Ruler Menu | String | The context menu when clicking on a ruler |
| Rulers | Boolean | Whether to display rulers. Defaults to "False" |
| Size | Array | The screen size of the window in an array of 2 integers {x, y} |
| Toolbar | String | The toolbar that is associated with the window |
Notes
-
The grid resolution divisor indicates what division of the units is used as the snap grid resolution. For example, 8 would indicate 1/8 of a unit.
-
The grid intervals specify the number of grid resolution units between each light (minor) or bold (major) display grid tick. For example {"inch", 8, 2, 4} would specify a grid with light ticks every 1/4 inch and a bold tick every 1/2 inch.
-
Window size and position are specified as percentages of the frame window.
-
If the menu, toolbar, activate macro, or close macro is not specified, CreateLayout() uses the default specified with SetDefaults(). If a layout-specific default was not specified with SetDefaults(), then CreateLayout() uses the generic default.
Example
CreateLayout("My First Layout", {
{"Grid Display", "True"},
{"Grid Snap", "True"}})
Error Codes
| Error Type | Meaning |
|---|---|
| Error | One of the options is invalid |
See Also
| Function | Summary |
|---|---|
| CloseLayout() | Closes a layout window |
| OpenLayout() | Creates a layout from a file |
| Save Layout() | Saves a layout to a file |
| SetLayoutOptions() | Change the options for a layout |
| SetDefaults() | Sets default menus, toolbars, and macros. |