Origin Ver. and Service Release (Select Help-->About Origin): Origin 2015 sr2
Operating System:Windows
Hi, I am currently trying to fit a gaussian peak in a dataset. I have not found a way to directly limit the NLSF fitting to only a user selected range (ie through GetN), so instead I am trying to use GetN to select the appropriate data range, dump that into a new worksheet, replot the selected data and apply to NLSF routine.
I am able to use GetN to pop up a dialog and have me select the appropriate region, and I can make a new data sheet. However I cannot get the data to insert into the sheet. Help on directly limiting the NLSF fit, or how to get the output from GetN into a worksheet would be great!
Here is my header and GetN code
#include <Origin.h>
#include <..\OriginLab\theme_utils.h>
#include <GetNBox.h>
GETN_TREE(gettr)
GETN_INTERACTIVE(Range1, "Select Range", "Graph")
if( GetNBox(gettr) ) // returns true if click OK button
{
DataRange dr;
dr.Add("Range1", gettr.Range1.strVal);
vector vData;
int index = 0; // range index
dr.GetData(&vData, index); // The data in vData is the selected data points
}
//make a new worksheet for the data
Worksheet newwks;
newwks.Create();