T O P I C R E V I E W |
hflemming |
Posted - 02/03/2010 : 12:12:58 PM Origin 8.0.63.988 and Service Release R6: Operating System: Windows SP3 64XP Hello Employing Samples\Automation Server\Excel\ Single Peak Fit, I have successfully opened Origin with Excel VBA, opened an ogw file, imported data, and recovered the fit parameters from a "summary" worksheet(wks) with linked cells.
I have discovered my Excel application needs to supply the Origin fitting process with a Row range and the Intercept value.
I do not know how to access the "Tree" parameters in a fitting function with Excel VBA the way LabTalk's NLBegin. The TreeNode and TreeNodes Classes are thinly described in the COM help.
I am using the ogw's as analysis templates but need to access the fitting parameters of the ogw before inputting data for crunching.
Any Excel VBA examples available that demonstrate access to the fitting function parameters in an ogw?
Thank you Howard
|
9 L A T E S T R E P L I E S (Newest First) |
VladGets1 |
Posted - 11/01/2016 : 07:54:15 AM I was looking for this script for a long time. Thank you.
quote: Originally posted by greg
Beginning with Origin 8.1 SR2 there is an X-Function for accessing operations : op_change. With it, you can get, set or set & run the operation tree values.
Here is an example based on hflemming's post:
// Get the operation tree op_change ir:=[LinFitRGB]"R FitLinear1" tr:=MyTr op:=get; // Change the input range to rows 8 to 18 MyTr.GUI.InputData.Range1.X$ = [LinFitRGB]Data!A[8:18]; MyTr.GUI.InputData.Range1.Y$ = [LinFitRGB]Data!B[8:18]; // Make the Intercept fixed MyTr.GUI.Fit.FixIntercept = 1.; // Fix the Intercept to 0.5 MyTr.GUI.Fit.FixInterceptAt = 0.5; // Now set the tree and run with the new values op_change ir:=[LinFitRGB]"R FitLinear1" tr:=MyTr op:=run;
To see the whole tree, execute MyTr.=
|
greg |
Posted - 03/20/2012 : 09:42:35 AM Beginning with Origin 8.1 SR2 there is an X-Function for accessing operations : op_change. With it, you can get, set or set & run the operation tree values.
Here is an example based on hflemming's post:
// Get the operation tree op_change ir:=[LinFitRGB]"R FitLinear1" tr:=MyTr op:=get; // Change the input range to rows 8 to 18 MyTr.GUI.InputData.Range1.X$ = [LinFitRGB]Data!A[8:18]; MyTr.GUI.InputData.Range1.Y$ = [LinFitRGB]Data!B[8:18]; // Make the Intercept fixed MyTr.GUI.Fit.FixIntercept = 1.; // Fix the Intercept to 0.5 MyTr.GUI.Fit.FixInterceptAt = 0.5; // Now set the tree and run with the new values op_change ir:=[LinFitRGB]"R FitLinear1" tr:=MyTr op:=run;
To see the whole tree, execute MyTr.=
|
freedom7 |
Posted - 08/09/2011 : 11:18:14 AM I see this is an old topic but I found it very useful. Thanks for the illustrations. |
dannyworthz |
Posted - 07/03/2011 : 09:39:49 AM Thanks for this illustration. I learned for it. |
TNavarro |
Posted - 05/18/2011 : 12:01:43 PM Hello guys, This is a good topic, I hoping to hear and discover new script. Thanks in advance. |
arsk |
Posted - 01/23/2011 : 10:58:49 PM Hey, I would like to see some of the scripts. I hope you might have done all those. I am looking forward to getting them also. Anyway thanks a lot for posting such wonderful details in such a simple and demonstrative manner. I will come here back again to check the updates.
Hello |
cpyang |
Posted - 02/05/2010 : 1:24:44 PM Thanks for providing the details, and also about PDF suggestion which we can investigate separately.
So it looks to me that you want to have control on the settings saved in the ogw. This will be best done via LT script which you can test separately from Origin and once the script works as expected, then send the script over from Excel.
We will then just give you some script examples on how to control these parameters. We will work on this in the next couple of days.
CP
|
hflemming |
Posted - 02/05/2010 : 12:58:48 PM Thank you for your interest
I wish the forum could support a pdf upload. Regardless screen shots in the above jpgs show how I hope to use the ogw.
I need to access the "green lock" in the upper corner of the Report wks to get to the fitting dialog parameters. I need to do this from Excel VBA.
Thank you |
cpyang |
Posted - 02/05/2010 : 10:36:45 AM We can creat a more complete example to illustrate the process of fitting using Origin from Excel, but maybe you can describe your "user story" so we can understand your need better.
If you are using Analysis Template, all your fitting results can be put into a summary sheet with links to the report table, so you can just access those cells in the summary sheet and there is no need to access the tree directly.
But if you are not using Analysis Template but using LT nlbegin etc, then the story will be very different, and then the access to the LT tree will be needed, but might be more involved from the VBA side to read an XML tree.
CP
|