Clone
Get a copy of the datarange.
BOOL Clone( DataRange & drDest, BOOL bPreserveSecurityDescriptor = FALSE )
//Create a copy of XY DataRange. void DataRange_Clone_Ex1() { //assume there exists an active worksheet with three colulmns Worksheet wks = Project.ActiveLayer(); if ( !wks ) { printf("Can not find any active worksheet!"); return; } DataRange dr; dr.Create();//init the object dr.Add("X", wks, 0, 0, -1, 0);//add the first column as x range dr.Add("Y", wks, 0, 1, -1, 1); DataRange drCloned; dr.Clone(drCloned); drCloned.Add("Z", wks, 0, 2, -1, 2);//add one more range to the copy, this operation has no effect on dr return; }
origin.h