#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. python基础和编程库

    Python编程从入门到实践-------基础入门 1.Python中的变量 2.Python首字母大写使用title()方法,全部大写upper()方法,全部小写lower()方法 3.Python ...

  2. js获取地址栏的参数

    //获取url参数 window.getParam = function(url, id) { url = url+ ""; var regstr = "/(\\?|\\ ...

  3. Delphi 类(TApplication)

    TApplication类用于开发窗口程序的类.此类封装了一个窗口应用程序,其方法和属性反映了窗口操作系统在建立.执行.维持以及析构该程序等方面的基本原则.Delphi的每个窗口程序都会自动声明一个A ...

  4. 【原理】RabbitMQ概要图

    使用流程 发布者(推送消息的一端): 创建一个tcp长连接connection,连接rabbitmq的监听端口5672: 在TCP长连接下创建一个信道channel,信道可以理解为connection ...

  5. 函数计算工具链新成员 —— Fun Local 发布啦

    刚刚,我们发布了函数计算工具链的新成员,Fun Local.欢迎大家使用! 如果你还不了解 Fun 是什么,我们来简单解释下. Fun 是什么 Fun 是 have Fun with Serverle ...

  6. 关于 CShellManager 的作用

    也许大家看到这个题目,未曾进行windows shell编程的同学呢,会不明白是什么意思,这里简单的介绍一下,windows shell就是可以使编写的程序与系统关联(如快捷方式,托盘图标等),管理系 ...

  7. CSS中block,inline和block-inline的区别(转载)

    http://www.cnblogs.com/KeithWang/p/3139517.html 总体概念 block和inline这两个概念是简略的说法,完整确切的说应该是 block-level e ...

  8. leetcode.字符串.205同构字符串-Java

    1. 具体题目 给定两个字符串 s 和 t,判断它们是否是同构的.如果 s 中的字符可以被替换得到 t ,那么这两个字符串是同构的.所有出现的字符都必须用另一个字符替换,同时保留字符的顺序.两个字符不 ...

  9. Pandas重复值处理

    import pandas as pd #生成数据 data1,data2,data3,data4=['a',3],['b',2],['a',3],['c',2] df=pd.DataFrame([d ...

  10. SpringMVC前后端参数交互

    Controller中使用JSON方式有多种 关键在于ajax请求是将数据以什么形式传递到后台 HTTP请求中: 如果是get请求,那么表单参数以name=value&name1=value1 ...