2.1.38 Path


Description

Returns a string containing the requested Origin path.

Syntax

VB: Function Path(Type As ByVal APPPATH_TYPES ) As String
C++: LPCSTR Path(APPPATH_TYPES Type )
C#: string Path(APPPATH_TYPES Type )

Parameters

Type
The Type parameter specifies which path is returned and must equal one of the following values:
APPPATH_GROUP = The path of the Group folder
APPPATH_PROGRAM = The path of the Origin executable
APPPATH_USER = The path of the User Files Folder

Remark

Examples

VBA

Private Sub MySampleProject()
    Dim originApp As Origin.ApplicationSI
    Dim projectName As String
    Dim path As String
    
    ' Connect to Origin
    Set originApp = New Origin.ApplicationSI
    
    ' Init the project file name
    projectName = "2D Bin and Fit.opj"

    ' Load the project from the installation folder
    path = originApp.path(APPPATH_PROGRAM) + "Samples\Curve Fitting\" + projectName
    originApp.Load (path)
    
    ' Save the project to the User Files Folder
    path = originApp.path(APPPATH_USER) + projectName
    originApp.Save (path)
End Sub

C#

using Origin;
static void TestPath()
{
	// Connect to Origin.
	Origin.ApplicationSI originApp = new Origin.ApplicationSI();

	// The file name of a sample Origin project.
	string strFileName = "2D Bin and Fit.opj";

	// Create the full path of the file for loading and ask Origin to load the project.
	string strFullFileName = originApp.Path(APPPATH_TYPES.APPPATH_PROGRAM) + "Samples\\Curve Fitting\\" + strFileName;
	originApp.Load(strFullFileName, System.Type.Missing);

	// Create the full path of the file for saving and ask Origin to save the project.
	strFullFileName = originApp.Path(APPPATH_TYPES.APPPATH_USER) + strFileName;
	originApp.Save(strFullFileName);
}

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
filePath = app.Path(app.APPPATH_PROGRAM) + "Samples\\Curve Fitting\\" + "2D Bin and Fit.opj"
app.Load(filePath)

LabVIEW

COM LV Path.gif

Version Information

8.0SR2

See Also