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