1. 程式人生 > 實用技巧 >【NX二次開發】Block UI 屬性型別

【NX二次開發】Block UI 屬性型別

String型別

//設定值
this->塊ID->GetProperties()->SetString("屬性名", NXString("字串"));

//獲取值
NXString NXstrTemp = "";
NXstrTemp = this->塊ID->GetProperties()->GetString("屬性名");
char cTemp[133] = "";
strcpy_s(cTemp, 133, NXstrTemp.GetLocaleText());
string strTemp = cTemp;

Strings型別

//設定值
vector<NXString> vecMates;
vecMates.push_back(NXString(
"字串1")); vecMates.push_back(NXString("字串2")); vecMates.push_back(NXString("字串3")); this->塊ID->GetProperties()->SetStrings("屬性", vecMates); //讀取值 GetStrings 哪位大佬提供程式碼

Logical型別

//設定值
this->塊ID->GetProperties()->SetLogical("屬性", true);

//讀取值
bool boolShow = this->塊ID->GetProperties()->GetLogical("
屬性");

Enum型別

//設定值
int intEnum0Value = 0;
this->塊ID->GetProperties()->SetEnum("屬性", intEnum0Value);

//讀取值
int intEnum0Value = this->塊ID->GetProperties()->GetEnum("屬性");

Integer型別

//設定值
int iValue = 99;
this->塊ID->GetProperties()->SetInteger("屬性", iValue); 

//獲取值
int iValue = this
->塊ID->GetProperties()->GetInteger("屬性");

Double型別

//設定值
double douValue = 99.0;
this->塊ID->GetProperties()->SetDouble("屬性", douValue);

//獲取值
double douValue = this->塊ID->GetProperties()->GetDouble("屬性");

Vector型別

//設定值
double douDir[3] = { 0.0,0.0,1.0 };
Vector3d vecDir(douDir[0], douDir[1], douDir[2]);
this->塊ID->GetProperties()->SetVector("屬性", vecDir);

//獲取值
double douDir[3] = {0.0,0.0,0.0};
Vector3d vceDir = this->塊ID->GetProperties()->GetVector("屬性");
douDir[0] = vceDir.X;
douDir[1] = vceDir.Y;
douDir[2] = vceDir.Z;

Point型別

//設定值
double douPoint[3] = { 0.0,0.0,1.0 };
Point3d poPoint(douPoint[0], douPoint[1], douPoint[2]);
this->塊ID->GetProperties()->SetVector("屬性", poPoint);

//獲取值
double douPoint[3] = {0.0,0.0,0.0};
Point3d poPoint = this->塊ID->GetProperties()->GetVector("屬性");
douPoint[0] = poPoint.X;
douPoint[1] = poPoint.Y;
douPoint[2] = poPoint.Z;

Tag型別

坐等大佬補充,請發到評論中

Utfstring型別

坐等大佬補充,請發到評論中

Utfstrings型別

坐等大佬補充,請發到評論中

Stlvector型別

坐等大佬補充,請發到評論中

Attachment型別

坐等大佬補充,請發到評論中

File型別

坐等大佬補充,請發到評論中

Bits型別

坐等大佬補充,請發到評論中