2.14.1.12 template_saveas

Brief Information

Save a graph, workbook or matrix window as a template

Command Line Usage

template_saveas pg:=[Graph1] category:="My Templates" template:="OffsetY" filepath:="C:\My Templates" emf:=0 bmp:=1;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Page pg

Input

Page

<active>
Specify the page which will be saved as tempalte. The active page is used by default if no page is specified.
Category category

Input

string

<auto>
Specify the template's category name. Default is UserDefined.
Template Name template

Input

string

<auto>
Specify the template name. Default is ORIGIN.
Template Description desc

Input

string

<unassigned>
This is used to add description about the template.
Template Type savetemplate

Input

string

<active>
Specify template type. It is set automatically according to the specified page. Which are Workbook Template (*.otw), Graph Template (*.otp) and Matrix Template (*.otm) respectively. Note that it is invisible in GUI.
File Path filepath

Input

string

<auto>
Specify the template file path. The default path is the User Files Folder. Note that the path should be exist, or the script gives an error.
EMF File emf

Input

int

1
Specify whether or not to save an EMF image file for the template preview. This check box is available when saving a graph template.
Bitmap bmp

Input

int

0
Specify whether or not to save a Bitmap image file for the template preview. This check box is available when saving a graph template.
Allow System Theme to Override loadsys

Input

int

<auto>
Specify whether or not to allow system theme upon loading to override the template settings. This check box is available when saving a graph window.
Dialog Hint asksave

Input

int

1
Dialog hint, for display only.

Description

This X-function is used to save a graph/workbook/matrix window to a template. There are different settings for saving these three windows to a template. And the dialog is different according to the specified page.

Examples

  1. Open the project: <Origin Program Directory>\Samples\Graphing\OffsetY.opj.
  2. Activate Graph1 and run template_saveas -d; in Command Window. In the pop-up dialog, specifies settings as below to save the template named OffsetY in My Template category, and create a bitmap for preview.

    Template saveas example 1.png

  3. Click the OK button to save this page as a template. The template is shown as follow.

    Template saveas example 2.png