Doc

LabTalk Object Type:

Utility Object

The doc object provides read only access to general project properties.

Properties:

Property Access Description
doc.AuditLog Read only, numeric

Returns 1 if the Audit Log is enabled for the current project. Else returns 0.

doc.dropCount Read only, numeric

Total number of files that have been dropped onto the Origin workspace. The OnOpen section in DOFILE.OGS will run once for each dropped file; dropIndex will indicate which file is being processed and will increment from 1 to dropCount.

doc.dropIndex Read only, numeric

When one or more data files are dropped into Origin, this property holds the number of files dropped.

doc.dropLayer Read only, numeric

When one or more data files are dropped onto a graph, this property holds the layer number the data is added to. If the data is dropped onto a worksheet, this property is set to 1. If the drop location is inside the Origin program window but outside of a worksheet or graph window, this property is set to 0. If the drop location is on the Origin program icon, this property is set to -1.

doc.dropWinName$ Read only, string

When one or more data files are dropped onto a graph or worksheet window, this property holds the window name. If the files aren't dropped on a window, or if the files are dropped onto the Origin program icon, then this property is set to "".

doc.isNew Read only, numeric

This property has a value of 1 if the project is a new project (not loaded from a file) and has never been saved. Once the project is saved, this property becomes 0.

doc.LineSpace Read/Write, numeric

Save line spacing setting to project: No = 0, Yes = 1.

doc.PWD Read only, numeric

Returns 1 if the Password protection is enabled for the current project. Else returns 0.

doc.SepP Read/Write, numeric

Save separator settings to project: No = 0, Yes = 1.

doc.wksNamen$ Read only, string

Returns the name of the nth worksheet. n is the order in which the worksheets were created in the project (1, 2, etc.).

Methods:

Method Description
doc.DCFileGroup(strExt, strDCPath)

This method is used to get the Data Connector file extension group.

//use string register, like %A to get the extension 
i = doc.DCFileGroup(A, "CSV_Connector"); // i = 1 if success
%A=; //*.csv;*.txt;*.asc;*.dat
doc.download(file)

This method is used to download file and install. file can be a template name or App name

doc.download("RaisedReliefMap.otpu")

file can also be fid

doc.download(227);//tangent app
On Template Center dialog, click any template will open the weblink with fid
https://www.originlab.com/fileexchange/details.aspx?fid=895
doc.rangescount([RangeType])

This method is used to get the number of project ranges. These ranges might have been generated by analysis operations, data import, etc. RangeType is an optional variable; if no value is assigned, the output will be the total number of data ranges. RangeType=16 outputs the number of empty ranges. RangeType=32 outputs the number of ranges generated by "Auto Fill".

Note: use list rng command to list details for all project ranges.

doc.FindLN(strRegister, strLN, windowtype)

This method is used to find the page Short Name from the Long Name.

  • Returns the number of page windows that match the long name string.
  • strRegister: output to which string register
  • strLN: Long name to search
  • windowtype: 2 = workbook, 3 = graph, 5 = matrix book

Examples:

doc.wksnamen$

If Data1 is the first worksheet created in the project, then the following (Script window) script returns Data1.

%Z = doc.wksName1$;
%Z = ;

doc.FindLN

If there is one workbook with the Long Name "some name", the following (Script Window) script returns 1 window found and its Short Name, Book2.

int nFound = doc.FindLN(A, "some name", 2);

nFound=;
nFound=1;
%A=;
Book2