2.1.14 FindGraphLayer


Description

Syntax

VB: Function FindGraphLayer(Name As ByVal String ) As GraphLayer
C++: GraphLayer FindGraphLayer(LPCSTR Name )
C#: GraphLayer FindGraphLayer(string Name )
Python: def FindGraphLayer(self, Name)

Parameters

Return

Remark

Examples

VB

    Sub FindGraphLayer()
        Dim app As Origin.IOApplication
        Dim gl As Origin.GraphLayer

        app = New Origin.ApplicationSI
        gl = app.FindGraphLayer("Graph1")
        If Not gl Is Nothing Then
            MsgBox("Find the graphlayer " + gl.Name.ToString())
        End If
    End Sub

C#

        public void FindGraphLayer()
        {
            Origin.IOApplication pOrigin;
            Origin.GraphLayer gl;

            pOrigin = new Origin.ApplicationSIClass();
            pOrigin.Visible = MAINWND_VISIBLE.MAINWND_SHOW;

            gl = pOrigin.FindGraphLayer("Graph1");
            if ( gl == null )
            {
                //use MessageBox class, you need to import System.Windows.Forms;
                MessageBox.Show("Can not get the graphlayer", "Error");
                return;
            }
            MessageBox.Show("The name of the graphlayer is " + gl.Name, "Success");
        }
        static void Main(string[] args)
        {
            Program p = new Program();
            p.FindGraphLayer();
        }

Python

import OriginExt as O
app = O.Application(); app.Visible = app.MAINWND_SHOW
grPageName = app.CreatePage(app.OPT_GRAPH)
gl = app.FindGraphLayer(grPageName)
print(gl.Name)

Version Information

8.0SR2

See Also