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
 worksheet not plotable?

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
bubbas Posted - 10/31/2006 : 10:46:28 AM
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
6   L A T E S T    R E P L I E S    (Newest First)
bubbas Posted - 11/03/2006 : 03:18:44 AM
Laurie got it ;) but i zipped i wrong file. I have resend now with the right data.

thx

bubbas
Deanna Posted - 11/02/2006 : 9:13:54 PM
I am very sorry, but I haven't received your email. Please send it again.

Deanna
OriginLab Technical Services
bubbas Posted - 11/02/2006 : 05:23:09 AM
okey i sended an email ...

thx

bubbas
Deanna Posted - 11/01/2006 : 8:52:03 PM
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
bubbas Posted - 11/01/2006 : 2:09:02 PM
 
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
Deanna Posted - 11/01/2006 : 03:49:03 AM
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

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