The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GetN selection into a new sheet

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
michaelbraun Posted - 07/09/2015 : 5:17:21 PM
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();
2   L A T E S T    R E P L I E S    (Newest First)
michaelbraun Posted - 07/10/2015 : 5:23:30 PM
Your solution partially worked. I was able to add part of the selected data (the y data points), but I cannot figure out how to also get the x data points out of the GetN selection. As this is a slightly different issue, I opened a new topic here: http://www.originlab.com/forum/topic.asp?TOPIC_ID=21311
Castiel Posted - 07/09/2015 : 7:55:27 PM
quote:
Originally posted by michaelbraun

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();




vector<double> vData = {1,2,3,4};
vectorbase& vb = newwks.Columns(0).GetDataObject();
vb = vData;

Now the first column in newwks is {1,2,3,4}.


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000