Hi,
I think the following example can help you figure out the relationship in column, vector and dataset.
void DatasetAndVector_ex1()
{
Worksheet wks = Project.ActiveLayer();// The current worksheet must have one column prior to execution
if(!wks)
return;
Column col1 = wks.Columns(0);// 1st column
int nRows = col1.GetNumRows(); // get the number of rows in the first column, also the size of the vector below
vector &vec = col1.GetDataObject();// Get data object
Dataset ds; // Create Origin C Dataset object not attached to an Origin data set
ds.Attach(wks,1); // Attach Origin C Dataset object ds to Origin data set wks(1)
ds.SetSize(nRows);
ds = vec; // Assign values to dataset from vector.
}
Further, I think you’d better go through the document about column, vector and dataset:
http://www.originlab.com/doc/OriginC/ref/Column-Class
http://www.originlab.com/doc/OriginC/ref/vector
http://www.originlab.com/doc/OriginC/ref/Dataset
Regards,
Yuki
OriginLab