字符串控件的應用
參考官方幫助案例:(這個方式感覺更好,第二種方式也可以)E:\NX1980\UGOPEN\SampleNXOpenApplications\C++\BlockStyler\ColoredBlock
普通格式:
讀取:
//方法一
string0->GetProperties()->GetString("Value")
//方法二
PropertyList *blockHeightProps = blockHeight->GetProperties();
double theHeight = blockHeightProps->GetDouble("Value");
delete blockHeightProps;
blockHeightProps = NULL;
寫入:
//方法一
string0->GetProperties()->SetString("Value", NewObjectAttr[0]);
//方法二
PropertyList *blockHeightProps = blockHeight->GetProperties();
blockHeightProps->SetDouble("MaximumValue", 100.0);
blockHeightProps->SetDouble("MinimumValue", 0.001);
delete blockHeightProps;
blockHeightProps = NULL;
comb格式:
讀取:(沒有試過自己猜測)
string03->GetProperties()->GetStrings("ListItems");
寫入:(用過)
vector<NXString> nxstrtxt03;
nxstrtxt03.push_back(NXOpen::NXString("鋼料"));
nxstrtxt03.push_back(NXOpen::NXString("圓料"));
nxstrtxt03.push_back(NXOpen::NXString("重定位鋼料"));
nxstrtxt03.push_back(NXOpen::NXString("STD"));
string03->GetProperties()->SetStrings("ListItems", nxstrtxt03);
其中"ListItems"和"Value"表示字符串控件的樣式,參考幫助文檔Block UI Styler