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
 worksheet not plotable?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bubbas

Germany
Posts

Posted - 10/31/2006 :  10:46:28 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5E
Operating System: Win Xp pro

Hey,

i have got a problem. I create with origin c a new worksheet with some columns. it is possible to plot this columns via origin c. but not if i try to plot them manually directly from the worksheet:

Creation:
 Worksheet wks2;
wks2.Create();
wks2.GetPage().Rename("T2TS");

//benötigte Daten in neues Worksheet kopieren

Dataset dsT2TSTheta(wks2,0);
wks2.Columns(0).SetName("Theta");
dsT2TSTheta = dsTheta;

Dataset dsT2TSAbsTheta(wks2,1);
wks2.Columns(1).SetName("AbsTheta");
dsT2TSAbsTheta = dsAbsTheta;


if i then try to plot the columns directly from the worksheet nothing happens ...

can someone help me please?

thx

bubbas

Deanna

China
Posts

Posted - 11/01/2006 :  03:49:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi. I can't spot the problem from the code you have posted. It seems that we will need the complete code or the data. Would you mind to post it here? Or send it to tech@originlab.com please.

Deanna
OriginLab Technical Services
Go to Top of Page

bubbas

Germany
Posts

Posted - 11/01/2006 :  2:09:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
 
BOOL myfunction(float energy)
{
string strColNameX, strColNameY1, strColNameY2;
Column colx, coly1, coly2;
int xColNum, y1ColNum, y2ColNum;
string GraphTemplate, GraphName;
string strPathToTemplate = "D:\\Data\\_work\\MPI\\Skripte\\Origin\\Templates\\";


//read WKS
PageBase pb;
WorksheetPage wp;
Worksheet wks;
string strWindowName;
int iPageType;
pb = Project.Pages();
if( !pb.IsValid() )
return FALSE;

strWindowName = pb.GetName();
iPageType = pb.GetType();
if( iPageType != EXIST_WKS )
return FALSE;

wp = (WorksheetPage) pb;
if( !wp.IsValid() )
return FALSE;


wks = (Worksheet) wp.Layers(0);

if( !wks.IsValid() )
return FALSE;



//lese Orginaldaten ein
int nColAbsTheta = wks.Columns("AbsTheta").GetIndex();
int nColI1 = wks.Columns("I1").GetIndex();

Dataset dsAbsTheta(wks, nColAbsTheta);
Dataset dsI1(wks, nColI1);
Dataset dsI0(wks, nColI0);



//neues Worksheet zum Arbeiten
Worksheet wks2;
wks2.Create();
wks2.GetPage().Rename("T2TS");

// Berechnung und kopieren der nötigen Daten in wks2
Dataset dsT2TSAbsTheta(wks2,0);
wks2.Columns(0).SetName("AbsTheta");
dsT2TSAbsTheta = dsAbsTheta;

//qz
Dataset dsT2TSQz(wks2,1);
wks2.Columns(1).SetName("qz");
dsT2TSQz=sin(dsAbsTheta*Pi/180)*0.001013546246585*energy;

//I1 / I0
wks2.AddCol();
Dataset dsI1Norm(wks2,2);
wks2.Columns(2).SetName("I1.norm");
dsI1Norm=dsI1 / dsI0;

....

LT_execute("win -s T");

return TRUE;
}


i mainly copy some columns from worksheet1 to wks2 and if i plot them from within originC no problem. but if i decide to plot them manually selecting the column as x and y and then plot line. nothing happens. i don't think it is related to the data. i had this problem with differnet data. i think its a problem of the way i create wks2 ...

thx for your effort

bubbas

Edited by - bubbas on 11/01/2006 2:13:15 PM
Go to Top of Page

Deanna

China
Posts

Posted - 11/01/2006 :  8:52:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bubbas.

When I tried to run the program on my PC, the Code Builder said, "Error, Variable dsI0 not declared." Therefore, I added one line:
Dataset dsI0(wks, nColI0);
Then it compiled fine.

I filled some arbitrate numbers in a worksheet with 3 columns, and called the function by typing:
myfunction(0.3);

A new worksheet with 3 columns was created; and, plotting manually from it was successful. I couldn't find any problem.

Now we wonder if your data is somewhat special. Would you mind send your data to tech@originlab.com?

Deanna
OriginLab Technical Services
Go to Top of Page

bubbas

Germany
Posts

Posted - 11/02/2006 :  05:23:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
okey i sended an email ...

thx

bubbas
Go to Top of Page

Deanna

China
Posts

Posted - 11/02/2006 :  9:13:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am very sorry, but I haven't received your email. Please send it again.

Deanna
OriginLab Technical Services
Go to Top of Page

bubbas

Germany
Posts

Posted - 11/03/2006 :  03:18:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Laurie got it ;) but i zipped i wrong file. I have resend now with the right data.

thx

bubbas
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