Append
Append data from a vector or Dataset object to this Origin C Curve object and update the related Origin Worksheet or Graph window from this Origin C Curve object.
BOOL Append(vector& v, int iMode = REDRAW_NONE)
Returns TRUE on successful exit and FALSE on failure.
EX1
//Can test with either a worksheet of data or a graph window with at least one plot int curvebase_Append_ex1(int npts) { PageBase pbTemp; pbTemp = Project.Pages(); // Get the project's active page Curve aa,bb; vector a(npts); vector b(npts); static int nn = 1; switch( pbTemp.GetType() ) { case EXIST_WKS: Worksheet wks(Project.ActiveLayer()); aa.Attach(wks,0); bb.Attach(wks,1); break; case EXIST_PLOT: GraphLayer gl = Project.ActiveLayer(); // Get active layer in project file if(gl) // If valid graph layer... { DataPlot dp = gl.DataPlots(0); // Get first data plot in graph layer if(dp) // If valid DataPlot... { Curve crv(dp); // Get Curve from DataPlot string dsXName; crv.HasX(dsXName); aa.Attach(dsXName); bb.Attach(dp.GetDatasetName()); } } break; default: printf("Active window is not worksheet or graph."); } for(int ii = 0; ii < npts; ii++) { a[ii] = nn++; b[ii] = rnd(); } aa.Append(a, REDRAW_REALTIME); bb.Append(b, REDRAW_REALTIME); return 0; }
vectorbase::Append, curvebase::Update
origin.h