属性说明

属性   类型   描述
  常规         
   BlockID    String    控件ID
   Enable    Logical    是否可操作
   Group    Logical    是否分组
   Show    Logical    是否可见
  对齐         
   PointOverlay    Logical    是否显示捕捉点
   SmartUpdateOption    Enum    智能更新选项
   SnapPointTypesEnabled    Bits    设置捕捉点类型的可见性
   SnapPointTypesOnByDefault    Bits    设置捕捉点内容被启用
  其他         
   附件         
    Bottom    Attachment    底部
    Left    Attachment   
    Right    Attachment   
    Top    Attachment    顶部
  特定于块         
   AllowConvergentObject    Logical    允许选择收敛体
   AutomaticProgression    Logical    自动跳到下一个控件
   BalloonTooltipImage    String    标题气泡提示图片
   BalloonTooltipLayout    Enum    标题气泡提示类型
   BalloonTooltipText    Utfstring    标题气泡提示文本
   Bitmap    String    控件位图
   BlendVirtualCurveOverlay    Logical    是否显示虚拟交线
   CreateInterpartLink    Logical    部件间连接图标在选择条
   Cue    Utfstring    提示
   InterpartSelection    Enum    部件间选择设置
   LabelString    Utfstring    标签标题
   MaximumScope    Enum    设置选择范围
   SelectMode    Enum    设置单选/多选 
   StepStatus    Enum    设置确定和应用按钮高亮
   ToolTip    Utfstring    动态提示文本标题
     

单选模式  Multiple=多选,Single=单选

selection0->GetProperties()->SetEnum("SelectMode",0);
//设置多选还是单选,Multiple=多选,Single=单选
selection0->SetSelectModeAsString("Multiple");    
//设置选择范围:3-整个装配   10-仅工作部件   11-装配和工作
selection0->GetProperties()->SetEnum("MaximumScope", 10);
//设置选择对象控件停在当前,不自动跳到下一个选择控件
selection_Track->Focus();

自动推进到下一个
selection0->GetProperties()->SetLogical("AutomaticProgression",true);

对象选择过滤 只能选组件

1 std::vector< NXOpen::Selection::MaskTriple > maskTriple;
2 Selection::MaskTriple mask1(UF_component_type, 0, 0);
3 maskTriple.push_back(mask1);
4 selection0->GetProperties()->SetSelectionFilter("SelectionFilter", Selection::SelectionActionClearAndEnableSpecific, maskTriple);

对象选择过滤 只能选体上圆柱面

std::vector< NXOpen::Selection::MaskTriple > maskTriple;
Selection::MaskTriple mask1(UF_solid_type, UF_solid_body_subtype, UF_UI_SEL_FEATURE_CYLINDRICAL_FACE);
maskTriple.push_back(mask1);
selection0->GetProperties()->SetSelectionFilter("SelectionFilter", Selection::SelectionActionClearAndEnableSpecific, maskTriple);

对象选择过滤 只能选基准坐标

std::vector< NXOpen::Selection::MaskTriple > maskTriple;
Selection::MaskTriple mask1( UF_coordinate_system_type, 0, 0);
maskTriple.push_back(mask1);
selection0->GetProperties()->SetSelectionFilter("SelectionFilter", Selection::SelectionActionClearAndEnableSpecific, maskTriple);

选择片体

https://www.cnblogs.com/KMould/p/14888582.html

选择实体

https://www.cnblogs.com/KMould/p/14888582.html

1 SelectionActionEnableAll/** Include objects in selection 在选择中包含对象*/,
2 SelectionActionEnableSpecific/** Include selected objects in selection 在选择中包括选定的对象 */,
3 SelectionActionDisableSpecific/** Remove selected objects from selection 从选择中删除选定的对象 */,
4 SelectionActionClearAndEnableSpecific/** Clear selection and include selected objects 清除选择并包括选定的对象*/,
5 SelectionActionAllAndDisableSpecific/** Select all objects except for selected objects 选择除已选对象外的所有对象*/

获取控件选择的对象转为tag_t类型

vector<tag_t>vecSelectFaces;
std::vector<TaggedObject*>objects = this->selection0->GetProperties()->GetTaggedObjectVector("SelectedObjects");
for (int i = 0; i < objects.size(); i++)
{
vecSelectFaces.push_back(objects[i]->Tag());
}

设置控件选择的对象。清空选择

1 vector< NXOpen::TaggedObject * > objectVector;
2 objectVector.clear();
3 this->selection0->SetSelectedObjects(objectVector);

设置控件隐藏

this->selection0->SetShow(false);
selection0->AddFilter(UF_component_type,0,0); 

所需头文件

#include <NXOpen/BlockStyler_SelectObject.hxx>

定义

NXOpen::BlockStyler::SelectObject* selection0;// Block type: Selection

初始化

selection0 = dynamic_cast<NXOpen::BlockStyler::SelectObject*>(theDialog->TopBlock()->FindBlock("selection0"));

控件更新回调

    else if (block == selection0)
{
//---------Enter your code here-----------
}

最新文章

  1. 推荐一个简单、轻量、功能非常强大的C#/ASP.NET定时任务执行管理器组件–FluentScheduler定时器
  2. javascript如何用户的判断操作系统
  3. Swiper说明&amp;&amp;API手册
  4. 4.27-4.30webstorm
  5. wireshark使用教程
  6. iOS 通过代码关闭应用程序
  7. A9裸机
  8. MFC调试小技巧
  9. lua for通过循环table一些差异
  10. Ubuntu 共享 转载
  11. CentOS之7与6的区别
  12. 第一把机械键盘 ikbc C-87
  13. tensorflow安装过程-(windows环境下)---详解(摆平了很多坑!)
  14. 选项卡js版封装
  15. MapReduce(五)
  16. Java第14章笔记
  17. 各类无次数限制的免费API接口整理
  18. SpringMVC系列(六)处理模型数据
  19. LeetCode664. Strange Printer
  20. Maven学习(三)-----Maven本地资源库

热门文章

  1. 前端不得不了解的TCP协议
  2. 【opencv】Java实现opencv 调用本地摄像头,实现人脸识别、人形识别、人眼识别
  3. Python数模笔记-Sklearn(4)线性回归
  4. 拦截器(Interceptor)与过滤器(Filter)
  5. Cookie&amp;Session-授课
  6. RHCE脚本题目详解
  7. C语言风格的 for 循环(SHELL的循环写法 已验证20200517)
  8. jmeter 通过CSV Data Set Config控件参数化
  9. Linux进阶之正则,shell三剑客(grep,awk,sed),cut,sort,uniq
  10. Scala 中为什么不建议用 return 关键字