【NX二次开发】Block UI 选择对象
2024-09-08 11:24:21
属性说明
属性 | 类型 | 描述 |
常规 | ||
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-----------
}
最新文章
- 推荐一个简单、轻量、功能非常强大的C#/ASP.NET定时任务执行管理器组件–FluentScheduler定时器
- javascript如何用户的判断操作系统
- Swiper说明&;&;API手册
- 4.27-4.30webstorm
- wireshark使用教程
- iOS 通过代码关闭应用程序
- A9裸机
- MFC调试小技巧
- lua for通过循环table一些差异
- Ubuntu 共享 转载
- CentOS之7与6的区别
- 第一把机械键盘 ikbc C-87
- tensorflow安装过程-(windows环境下)---详解(摆平了很多坑!)
- 选项卡js版封装
- MapReduce(五)
- Java第14章笔记
- 各类无次数限制的免费API接口整理
- SpringMVC系列(六)处理模型数据
- LeetCode664. Strange Printer
- Maven学习(三)-----Maven本地资源库