GetDataObject
Creates a DataObject& from DataObject name. Can be used to get a DateObject& from related DataObject name(Example2).
DataObject & GetDataObject( LPCSTR name )
A refernce to DataObject (A MatrixObject or Column), if invalid name -- the object is invalid
EX1
//Get all the Dataset name from the worksheet and matrix in the Project. void Project_GetDataObject_Ex1() { foreach (string strDatasetName in Project.DatasetNames) { DataObject& obj = Project.GetDataObject(strDatasetName); if(obj.IsValid()) { printf("Dataset %s in some wks/matrix\n", strDatasetName); } else { printf("Dataset %s is not in any wks/matrix\n", strDatasetName); } } }
EX2
void Project_GetDataObject_Ex2() { string strCurveName = Project.ActiveCurve().GetName(); DataObject& obj = Project.GetDataObject(strCurveName); if(obj != NULL) { Column cc = obj; if(cc) out_int("Col Index = ", cc.GetIndex()); } }
Project::GetObject
origin.h