NX11+VS2013

     #include <NXOpen/DisplayManager.hxx>
#include <NXOpen/Body.hxx>
#include <NXOpen/BodyCollection.hxx>
#include <NXOpen/NXException.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx> NXOpen::Session *theSession = NXOpen::Session::GetSession();
NXOpen::Part *workPart(theSession->Parts()->Work());
NXOpen::Part *displayPart(theSession->Parts()->Display()); std::vector<tag_t> BodyVecotor;
NXOpen::Body *WorkBody;
NXOpen::BodyCollection *Bodys = workPart->Bodies();
NXOpen::BodyCollection::iterator Ite = Bodys->begin();
for (; Ite != Bodys->end(); ++Ite)
{
WorkBody = (*Ite);
BodyVecotor.push_back(WorkBody->Tag()); NXOpen::DisplayModification *displayModification1;
displayModification1 = theSession->DisplayManager()->NewDisplayModification();
displayModification1->SetNewColor();
std::vector<NXOpen::DisplayableObject *> objects1();
NXOpen::Body *body1(dynamic_cast<NXOpen::Body *>(workPart->Bodies()->FindObject(WorkBody->JournalIdentifier())));
objects1[] = body1;
displayModification1->Apply(objects1);
} char msg[];
sprintf_s(msg, "当前有%d个体", BodyVecotor.size());
lw->Open();
lw->WriteLine(msg);

NX二次开发-NXOpen方式遍历所有体workPart->Bodies();的更多相关文章

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

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

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

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

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

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

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

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

  5. NX二次开发-NXOpen::Drawings::DrawingSheet 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导出STEP Step214Creator *step214Creator1;

    没有什么可以看的,NXOPEN直接录制一下导出STEP就可以了.录制出来自己挑需要的代码拿过来改一下. NX9+VS2012 #include <NXOpen/Part.hxx> #inc ...

随机推荐

  1. Boost Download

    { //https://www.boost.org/users/history/version_1_71_0.html }

  2. 【LeetCode 7】整数反转

    题目链接 [题解] 没什么说的. 就注意一点. 可以在*10+n%10的时候. 顺便判断有没有溢出. (直接用longlong可真是机制..) [代码] class Solution { public ...

  3. Delphi实现提取可执行文件内部所有图标

    本实例实现的功能是能够从用户选择的可执行文件(后缀名为exe)中提取所有图标并且显示在窗体上. 在窗体中添加TImage 组件.TOpenDialog组件和TButton组件,TImage组件充当显示 ...

  4. 天照(amaterasu)

    天照(amaterasu) 有些时候,出题人真的不想写背景. 总而言之,天照现在有一个长度为 $ N $ 序列,她有 $ M $ 次询问,对于第 $ i $ 次询问 $ l_i,r_i,x_i $ 你 ...

  5. 如何在一个for语句中迭代多个对象(2.7)

    如何在一个for语句中迭代多个对象 总结: 并行迭代使用zip(l1, l2, l3) 每次迭代从3个列表里各取一个数据 串行迭代使用itertools.chain(l1, l2, l3) 相当于把3 ...

  6. python_way day14 CSS,莫泰对话框

    python_way day14 CSS 层叠样式表 一.CSS作用域: 二.css标签选择器 三.css样式 四.莫泰对话框: 一.css作用域: 基本用法:style="样式" ...

  7. node 创建静态web服务器(下)(处理异步获取数据的两种方式)

    接上一章. 上一章我们说创建的静态web服务器只能识别html,css,js文件,功能较为单一,且图片格式为text/html,这是不合理的. 本章,我们将解决该问题. 这里,我们先准备好一个json ...

  8. 获取hdfs集群信息(fs.defaultFS)

    [root@hive-dp-7bd6fd4d55-wctjn hive-1.1.0-cdh5.14.0]# hdfs getconf -confKey fs.default.name19/12/04 ...

  9. python数据结构之快速排序

    def quick_sort(nums): if not nums: return [] else: # 这里取第0个数为基点 flag = nums[0] # 小于flag 的放到左边 left = ...

  10. Linux的各个发行版本(二)

    CentOS CentOS是世界上使用的最好的Linux服务器发行版之一,占了全世界Linux服务器的30%. 它是Red Hat 的衍生产品,提供了稳定的服务器环境. 特点: 支持的X86-64架构 ...