To find the user defined label by name in Worksheet.
int find_user_defined_label(Worksheet& wks, LPCSTR lpcszLabelName)
Returns label type RCLT_* value or -1 if not found. See label type define in oc_const.h file ROWCOLLABELTYPE enum.
EX1
void find_user_defined_label_ex1() { Worksheet wks = Project.ActiveLayer(); if ( !wks ) return; // find the label named Threshold int nLabelType = find_user_defined_label(wks, "Threshold"); if ( nLabelType < 0 ) return; Grid gg; gg.Attach(wks); vector vv; vector<string> vsLabels; // get the label contents to a string array if( gg.GetLabelsByType(vsLabels, nLabelType) ) { // convert string array to double array convert_str_vector_to_num_vector(vsLabels, vv); printf("Size=%d, First Value=%f\n", vv.GetSize(), vv[0]); } }
Grid::GetLabelsByType, convert_str_vector_to_num_vector
origin.h