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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 export ASCii into txt file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tony_lincoln

USA
Posts

Posted - 09/09/2006 :  11:29:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear friends,
After the curve fitting, I need to output fitting result (the parameters like NLSF.p1) into one txt file. But there is no demo codes on http://www.originlab.com/index.aspx?s=8&lm=243.
Where can I find some demo codes? Thansk.
Tony

Mike Buess

USA
3037 Posts

Posted - 09/10/2006 :  07:50:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tony,

There is no example for that. The easiest way would be copy the results you want to a worksheet and use ExportASCII in the Worksheet class to export the worksheet to file.

You haven't spelled out your overall goal but I gather it is to import several files, fit each file and save all parameters to ASCII file. Before putting a lot of effort into that you should probably check out the MultiFit on the File Exchange. It fits multiple datasets and combines all parameters to a single worksheet.

Mike Buess
Origin WebRing Member
Go to Top of Page

tony_lincoln

USA
Posts

Posted - 09/10/2006 :  10:32:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

Thanks for your info. Its helpful. You are right, I need to import A LOT OF files, fit each file and save all parameters to ASCII file.

But I am sorry to say, that I still have two questions here:

How to set the graph name in Origin as "Tony_curveA" instead of "Graph1"?
GraphPage gpg = Project.GraphPages("GraphJuntao1");
The above sentence can not rename the graph.

Is there any API to show all methods of every class? Like Java API? e.g. I would like to find all methods of class worksheet, but if I type worksheet in Origin Help, I can not find all methods. So, how to rename the worksheet name from "data1" to "Tony_dataA"? What is the method name?

The renaming of worksheet and graphs is important if you have a lot of curves --- I need to find the correspondence. Thanks in advance!

Tony
Go to Top of Page

Deanna

China
Posts

Posted - 09/10/2006 :  11:37:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tony. To rename a page (graph page or worksheet page), the following code should work.


void rename_a_worksheet()
{
Page wp("Data1");

if ( !wp.IsValid())
return;

wp.Rename("TonyDataA");


}



The character '_' is not allowed in the page name, please do not use it.

If you want to know all methods for every class, please refer to the header files that correspond to the classes. You might find out which header file to look for with the Programming Help File. For instance, the class of WorksheetPage is in Project.h.

Deanna
OriginLab GZ Office
Go to Top of Page

tony_lincoln

USA
Posts

Posted - 09/11/2006 :  10:48:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Deanna,

Thanks for the quick reply. I did not find the method Rename() yesterday, today it works very well.
The character '_' is not allowed in the worksheet name, but IT IS allowed in the graph name! I wonder why. Either worksheet or graph is page... The following is my codes:

string strTemp = getBaseName(txtFileFullName[i]);
strTemp.Replace("cut_normalizedCell_ ", "Graph_");
gpg.Rename(strTemp);
printf("Graph's name: %s\n", gpg.GetName());

The output is: Graph's name: Graph_118_Exo70

Thanks.
Tony
Go to Top of Page

tony_lincoln

USA
Posts

Posted - 09/11/2006 :  10:51:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry one more question: why are "_" and "-" not allowed in the page name? Is this a bug in the Origin C?
Tony
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 09/11/2006 :  12:09:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Tony,

Origin window naming conventions predate Origin C by quite a while. In general, special characters are allowed in graph window names but not in worksheet window names. In particular, the underscore '_' is not allowed in a worksheet name in order prevent two underscores from appearing in a dataset name... wksName_colName. Note there are also limitations on the length of window names...

http://www.originlab.com/www/support/resultstech.aspx?ID=282&language=English

Mike Buess
Origin WebRing Member
Go to Top of Page

tony_lincoln

USA
Posts

Posted - 09/11/2006 :  12:34:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Now it's clear. Thank you, Mike.
Tony
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000