OpenLayout()
Summary
Creates a layout from a file.
Syntax
layout_name = OpenLayout(string file_name, array options)
| Argument | Contents |
|---|---|
| file_name | The path and file name of the layout |
| Option | Type | Contents |
|---|---|---|
| Activate Macro | String | The name of a macro that is called whenever the window is activated |
| Close Macro | String | The name of a macro that is called when the user closes the window from the system menu |
| 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 |
| 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} |
| Rulers | Boolean | Whether to display rulers. Defaults to "False". |
| Search Macro | String | The name of a macro that is called whenever a file within the layout file is not found. |
| 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
-
OpenLayout() opens files created by SaveLayout().
-
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.
-
If the menu, toolbar, activate macro, or close macro is not specified, OpenLayout() uses the default specified with SetDefaults(). If a layout specific default was not specified with SetDefaults(), then OpenLayout() uses the generic default.
-
The values for the position of the map window are expressed as percentages of the frame window, where 1.0 is equivalent to 100 percent.
-
If the printer of the saved layout is not found, the user is prompted whether to use the default printer instead.
Returns
A string indicating the name of the layout.
Example
folder = RunMacro("G30 Tutorial Folder")
lyt = OpenLayout(folder + "adjust.lay", {
{"Grid Display", "True"},
{"Grid Snap", "True"}})
Error Codes
| Error Type | Meaning |
|---|---|
| Error | The file does not exist, or one of the options is invalid |
| Escape | The user clicked Cancel |
See Also
| Function | Summary |
|---|---|
| SaveLayout() | Saves a layout to a file |
| CloseLayout() | Closes a layout window |
| CreateLayout() | Create a new layout window |
| SetDefaults() | Sets default menus, toolbars, and macros. |