1 //选择对象 2 std::vector<TaggedObject*> selObjs; 3 selObjs = Select_edge->GetSelectedObjects(); 4 //选择对象过滤 5 std::vector<Selection::MaskTriple > maskTriple; 6 Selection::MaskTriple mask2(UF_solid_type, UF_solid_edge_subtype, UF_UI_SEL_FEATURE_ANY_EDGE);//边 7 maskTriple.push_back(mask2); 8 PropertyList* selectionObjProps = Select_edge->GetProperties(); 9 selectionObjProps->SetSelectionFilter("SelectionFilter", Selection::SelectionAction::SelectionActionClearAndEnableSpecific, maskTriple); 10 delete selectionObjProps; 11 selectionObjProps = NULL; 12 13 // SelectionActionEnableAll 14 // 在选择中包括对象。 15 // 16 // SelectionActionEnableSpecific 17 // 在选择中包括选定的对象。 18 // 19 // SelectionActionDisableSpecific 20 // 从选择中删除选择的对象。 21 // 22 // SelectionActionClearAndEnableSpecific 23 // 清除选择并包括所选对象。
可用于体、面、边、等控件。
选择对象官方写法:
1 PropertyList* selectionObjProps = selectionObj->GetProperties(); 2 selObjs = selectionObjProps->GetTaggedObjectVector("SelectedObjects"); 3 delete selectionObjProps; 4 selectionObjProps = NULL;
字体传递:
1 PropertyList* textColorFontWidth = textColorFontWidth0->GetProperties(); 2 NXString selType = textColorFontWidth->GetString("Font Value"); //字体 3 vector<int>colorID = textColorFontWidth->GetIntegerVector("ColorValue"); //颜色 4 int xiankuan = textColorFontWidth->GetEnum("WidthValue"); //线宽 5 delete textColorFontWidth; 6 textColorFontWidth = NULL;
toggle开关:
1 PropertyList *toggle = toggleIsFilter->GetProperties(); 2 bool isFilter = toggle->GetLogical("Value"); 3 delete toggle; 4 toggle = NULL;
enum枚举:
1 PropertyList *enumFilterProps = enumFilter->GetProperties(); 2 int selType = enumFilterProps->GetEnum("Value"); 3 delete enumFilterProps; 4 enumFilterProps = NULL;
1 int enumValue = enum0->GetProperties()->GetEnum("Value") 2 上式中enum0为对话框中设置的枚举ID; 3 "Value" 为相应属性名称;
expression表达式:
1 double expres=expression0->Value();
整数:
1 int a=integer0->GetProperties()->GetInteger("Value");
double双精度:
1 同表达式;
点:
1 Point3d poin = point0->GetProperties()->GetPoint("Point");
矢量:
1 Vector3d vec = vector0->GetProperties()->GetVector("Vector");