OpenDocument
Opens a data file with the specified path. Returns a reference to the opened document.
Syntax
OpenDocument(filePath)
Parameters
Parameter |
Type |
Description |
---|---|---|
filePath |
string |
Full path of the file |
Return
Returns a reference to the opened document (nex.NexDoc
object in Python, integer in NexScript).
The function returns invalid document reference if OpenDocument operation failed.
Note
See Specifying Windows file paths in Python for details on specifying file paths with backslashes in Python.
Examples
Python
import nex
# This function can be used to open all supported data file formats
doc1 = nex.OpenDocument(r"C:\Data\File1.nex5")
doc2 = nex.OpenDocument(r"C:\Data\File1.nex5")
doc3 = nex.OpenDocument(r"C:\Data\File3.msrd")
NexScript
% This function can be used to open all supported data file formats
doc1 = OpenDocument("C:\Data\File1.nex5")
doc2 = OpenDocument("C:\Data\File1.nex5")
doc3 = OpenDocument("C:\Data\File3.msrd")
Note
Before opening a text file, specify text file import options using View/Options menu command.