2.2.4.38.2 Project::ActiveCurve

Description

Get the active Curve which is in the active layer of the active page(window).

Syntax

Curve ActiveCurve( )

Parameters

Return

the active Curve object

Examples

EX1

// For this example to run, create a graph  with at least one dataplot.
void    run_Project_ActiveCurve()
{
    using cc = Project.ActiveCurve();
    if(cc.IsValid())
    {
        Dataset xd;
        printf("Active dataset is %s",cc.GetName());
        if(cc.AttachX(xd, FALSE))
            printf(", its corresponding X dataset is %s",xd.GetName());
        
        printf(".\n");
    }
    else
        out_str("There is no active dataset");
}

Remark

The Active Curve in the active layer of the active page(window)


Dataset, Curve and Matrix are different kinds of objects when compared with other

Origin objects. Layers and Pages etc are pure wrapper classes for internal Origin

objects so that you can make assignment between them and they will still be

referencing the same internal Origin object. For example, both gg1 and gg2 below

are the same thing


GraphLayer gg1 = Layer("Graph1");

GraphLayer gg2;

gg2 = gg1;// having two reference object to the same internal layer in Origin


On the other hand, Datasets and Curves and Matrix are wrapper for data objects inside

Origin and the assigment between them are interpreted as arithmetic assignments, so


Curve cc("data1_a", "data1_c");

Curve dd("data1_a", "data1_d");

dd = cc;// put all values from Y column of cc into Y column of dd


Due to this reason, you cannot do things like


Curve cc = Project.ActiveCurve();


but rather, you should use Project.ActiveCurve directly or use the "using" notation.

See Also

Project::ActiveCurveBase, Project::ActiveFolder, Project::ActiveLayer

Header to Include

origin.h