#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. Java高并发网络编程(三)NIO

    从Java 1.4开始,Java提供了新的非阻塞IO操作API,用意是替代Java IO和Java Networking相关的API. NIO中有三个核心组件: Buffer缓冲区 Channel通道 ...

  2. Java中几种排序算法

    1.冒泡排序算法 通过多次比较(相邻两个数)和交换来实现排序 public class bubble { public static void bubbleSort(int[] a) { int te ...

  3. pc端与移动端适配解决方案之rem

    使用方式: 在html页面开头,引入下面的原生js代码 (function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'ori ...

  4. 编码格式分类: 前后端传递数据的编码格式contentType

    urlencoded:form表单和ajax提交数据的默认编码格式 form-data:传文件 application/json:json格式数据 >>> 前后端分离 urlenco ...

  5. 「CTS2019 | CTSC2019」氪金手游 解题报告

    「CTS2019 | CTSC2019」氪金手游 降 智 好 题 ... 考场上签到失败了,没想容斥就只打了20分暴力... 考虑一个事情,你抽中一个度为0的点,相当于把这个点删掉了(当然你也只能抽中 ...

  6. 「题解」:$Smooth$

    问题 A: Smooth 时间限制: 1 Sec  内存限制: 512 MB 题面 题面谢绝公开. 题解 维护一个队列,开15个指针,对应前15个素数. 对于每一次添加数字,暴扫15个指针,将指针对应 ...

  7. K8S 容器之间通讯方式

    概述 首先k8s里面容器是存在于pod里面的,所以容器之间通讯,一般分为三种类型: 1. pod内部容器之间 2. pod 与 pod 容器之间 3. pod 访问service服务 pod内部容器之 ...

  8. jenkins在pipline中运行后台命令

    需求 在jenkin中启动java程序或者python程序的时候,希望程序在后台执行,并在jenkins构建完成之后继续执行.在工作中有两个地方我碰到了这种需求 在shell script输入框中pi ...

  9. linux 创建多级目录 mkdir -p

    原文地址:http://www.dutor.net/index.php/2010/06/cmd-mkdir-p/ mkdir的-p选项允许你一次性创建多层次的目录,而不是一次只创建单独的目录.例如,我 ...

  10. HTML —— 表格

    复习下关于html中的表格. 基本结构: 表格由 table 标签为父标签进行包裹,可以在 table 上添加几种属性. border : 定义表格的边框. cellspacing : 间距,指单元格 ...