#include <uf_defs.h>
#include <uf_ui_types.h>
#include <iostream>
#include <NXOpen/Session.hxx>
#include <NXOpen/UI.hxx>
#include <NXOpen/NXMessageBox.hxx>
#include <NXOpen/Callback.hxx>
#include <NXOpen/NXException.hxx>
#include <NXOpen/BlockStyler_UIBlock.hxx>
#include <NXOpen/BlockStyler_BlockDialog.hxx>
#include <NXOpen/BlockStyler_PropertyList.hxx>
#include <NXOpen/BlockStyler_Group.hxx>
#include <NXOpen/BlockStyler_FaceCollector.hxx>
#include <uf.h>
#include <uf_obj.h>
#include <NXOpen/NXObjectManager.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Face.hxx>
#include <NXOpen/FaceTangentRule.hxx>
#include <NXOpen/ScCollectorCollection.hxx>
#include <NXOpen/ScRuleFactory.hxx> UF_initialize(); //NXOPEN初始化
NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display()); //选择面控件
PropertyList* FaceSelectProps = face_select0->GetProperties();
std::vector<NXOpen::TaggedObject*> faces = FaceSelectProps->GetTaggedObjectVector("SelectedObjects");
delete FaceSelectProps;
FaceSelectProps = NULL; tag_t FaceTag = faces[]->Tag(); //对选中的面设置颜色
UF_OBJ_set_color(FaceTag, ); //给入一个面
NXOpen::Face *face1(dynamic_cast<NXOpen::Face *>(NXOpen::NXObjectManager::Get(FaceTag))); //使用NXOPEN相切面规则
std::vector<NXOpen::Face *> boundaryFaces1();
NXOpen::FaceTangentRule *faceTangentRule1;
faceTangentRule1 = workPart->ScRuleFactory()->CreateRuleFaceTangent(face1, boundaryFaces1, 0.050000000000000003);
std::vector<NXOpen::SelectionIntentRule *> rules1();
rules1[] = faceTangentRule1; NXOpen::ScCollector* scCollector1 = workPart->ScCollectors()->CreateCollector();
scCollector1->ReplaceRules(rules1, false); std::vector<NXOpen::TaggedObject*> BB = scCollector1->GetObjects();
for (int i = ; i < BB.size(); i++)
{
UF_OBJ_set_color(BB[i]->Tag(), );
} UF_terminate();

NX二次开发-NXOPEN找相切面方法ScRuleFactory()->CreateRuleFaceTangent的更多相关文章

  1. NX二次开发-NXOPEN自动切换到工程图模块

    UFUN的API里是没有切换到工程图的函数的,NXOPEN里是有方法可以用的.不过应该是不支持NX9以下的版本. NX9的不能录制出来,在UI类里有方法 NX9+VS2012 #include < ...

  2. NX二次开发-NXOPEN更改工程图视图名字baseView1->SetName("LSY");

    NX9+VS2012 #include <uf.h> #include <uf_draw.h> #include <uf_obj.h> #include <u ...

  3. NX二次开发-NXOpen获取边的端点NXOpen::Edge::GetVertices

    NX9+VS2012 #include <NXOpen/Features_BlockFeatureBuilder.hxx> #include <NXOpen/Features_Fea ...

  4. NX二次开发-NXOpen::Drawings::DrawingSheet Class Reference

    NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...

  5. NX二次开发-NXOpen::CoordinateSystemCollection Class Reference

    NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...

  6. NX二次开发-NXOpen::WCS Class Reference

    NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...

  7. NX二次开发-NXOpen中Point3d类型转换成point类型

    NX9+VS2012 #include <NXOpen/NXObject.hxx> #include <NXOpen/Part.hxx> #include <NXOpen ...

  8. NX二次开发-NXOPEN设置工程图表格注释字体workPart->Fonts()->AddFont("chinesef_fs", NXOpen::FontCollection::TypeNx);

    NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...

  9. NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView

    NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...

随机推荐

  1. Excel处理

    转载:https://www.cnblogs.com/cang12138/p/5606130.html 上面的博友已经讲的很清楚了,但是我们在服务端是获取不到前端上传文件的绝对路径的(因为新浏览器有安 ...

  2. Android Studio奇淫巧技

    目录 3.1 Android Studio使用初探 Project面板 Stucture面板 Android Monitor Keymap Tip of the Day 快速查找 Search Act ...

  3. QT之sqlite连接

    啥也没做,按说明直接啪啪写一堆代码 QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); //open datebase ...

  4. CF 1097D - Hello 2019 D题: Makoto and a Blackboard

    目录 Catalog Solution: (有任何问题欢迎留言或私聊 && 欢迎交流讨论哦 Catalog Problem:传送门  Portal  原题目描述在最下面.  给一个数n ...

  5. 谈谈-Android Studio 调试功能

    先编译好要调试的程序. 1.设置断点 选定要设置断点的代码行,在行号的区域后面单击鼠标左键即可. 2.开启调试会话 点击红色箭头指向的小虫子,开始进入调试. IDE下方出现Debug视图,红色的箭头指 ...

  6. 剑指offer——59二叉搜索树的第k大节点

    题目描述 给定一棵二叉搜索树,请找出其中的第k小的结点.例如, (5,3,7,2,4,6,8)    中,按结点数值大小顺序第三小结点的值为4.   题解: 考察的就是中序遍历 不过注意进行剪枝 cl ...

  7. Matlab转opencv遇到的坑

    之前在学校里面做研究用都是Matlab,后来工作中因为对算法的实时性有很高的要求,所以转向了opencv.我想我遇到的第一大坑就是opencv默认的通道顺序是BGR而不是RGB. 这个顺带的就是灰度化 ...

  8. webpack4 入门配置研究

    1. 全局安装 npm install webpack webpack-cli webpack-dev-server -g 1.1)输密文的密码(电脑开机) 1.2)安装成功 2. 输入命令mkdir ...

  9. ArcGis 字段计算器表达式(Field calculator expression).cal文件与标注表达式(label expression).lxp的实质及其编码方式、解析方法

    ArcGis 字段计算器表达式可以保存为一个扩展名为.cal的文件,该文件的实质是一个文本文件,编码方式为 UTF-16-LE. 官方的说明是“ArcGIS 应用程序使用 UTF-16-LE 编码读写 ...

  10. python的magic methods

    https://pycoders-weekly-chinese.readthedocs.io/en/latest/issue6/a-guide-to-pythons-magic-methods.htm ...