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. rest_framework框架实现之(认证)

    一认证 我们可以想想,我们要访问一个页面,需不需要对其进行认证,希望进入页面的时候看到哪些内容,一般是根据用户的不同而不同 首先,我们先设计一个表,如何知道对方通过了验证,我们可以考虑给其加一个tok ...

  2. CleanMyMac x如何关闭自动更新,CleanMyMac关闭自动更新的方法

    在众多Mac清理软件中,CleanMyMac x应该是大多数Mac用户的选择,因为它不仅可以帮助我们清理系统垃圾,还可以帮助我们彻底卸载Mac上不需要的应用程序.今天要给大家介绍的是CleanMyMa ...

  3. 阿里小程序Serverless 操作指南

    小程序云 小程序云(Mini Program Cloud)是阿里云面向小程序场景提供的一站式云服务,帮助开发者实现一云多端的业务战略,提供了有服务器和无服务器两种模式.云应用是有服务器模式,提供了包括 ...

  4. 数学思维——cf1244C

    可惜cf不能用int128,不然这个题就是个exgcd的板子题 这是exgcd的解法,但是只用ll的话会溢出 #include<bits/stdc++.h> using namespace ...

  5. TeleportArea可瞬移的目标位置

    TeleportArea.png 1.可以自定义mesh ,想要什么区域就可以设置什么区域的mesh网格.2.Collider 组件必须有,否则无法进行位置移动,它用来检测激光笔是否打到该区域.3.M ...

  6. 【linux】netlink

    Netlink实现网卡上下线监控 https://blog.csdn.net/sourthstar/article/details/7975999

  7. 提升R代码运算效率的11个实用方法

    提升R代码运算效率的11个实用方法 众所周知,当我们利用R语言处理大型数据集时,for 循环语句的运算效率非常低.有许多种方法可以提升你的代码运算效率,但或许你更想了解运算效率能得到多大的提升.本文将 ...

  8. 2019杭电多校第三场hdu6606 Distribution of books(二分答案+dp+权值线段树)

    Distribution of books 题目传送门 解题思路 求最大值的最小值,可以想到用二分答案. 对于二分出的每个mid,要找到是否存在前缀可以份为小于等于mid的k份.先求出这n个数的前缀和 ...

  9. Hyperledger:常见加密算法分类列表

    算法原理查询:http://mathworld.wolfram.com   加密散列函数 (消息摘要算法,消息认证码,MD算法) Keyed-hash message authentication c ...

  10. [未解决]报错:DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()

    DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()