NX二次开发-NXOpen方式遍历所有体workPart->Bodies();
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();的更多相关文章
- NX二次开发-NXOpen获取边的端点NXOpen::Edge::GetVertices
NX9+VS2012 #include <NXOpen/Features_BlockFeatureBuilder.hxx> #include <NXOpen/Features_Fea ...
- NX二次开发-NXOPEN自动切换到工程图模块
UFUN的API里是没有切换到工程图的函数的,NXOPEN里是有方法可以用的.不过应该是不支持NX9以下的版本. NX9的不能录制出来,在UI类里有方法 NX9+VS2012 #include < ...
- NX二次开发-NXOpen::CoordinateSystemCollection Class Reference
NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...
- NX二次开发-NXOPEN获取所有工程图和所有视图DrawingSheet,DrawingSheetCollection,DraftingView
NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...
- NX二次开发-NXOpen::Drawings::DrawingSheet Class Reference
NX11+VS2013 #include <NXOpen/Section.hxx> #include <NXOpen/SectionCollection.hxx> #inclu ...
- NX二次开发-NXOpen::WCS Class Reference
NX11+VS2013 #include <NXOpen/Part.hxx> #include <NXOpen/PartCollection.hxx> #include < ...
- NX二次开发-NXOpen中Point3d类型转换成point类型
NX9+VS2012 #include <NXOpen/NXObject.hxx> #include <NXOpen/Part.hxx> #include <NXOpen ...
- NX二次开发-NXOPEN设置工程图表格注释字体workPart->Fonts()->AddFont("chinesef_fs", NXOpen::FontCollection::TypeNx);
NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...
- NX二次开发-NXOPEN导出STEP Step214Creator *step214Creator1;
没有什么可以看的,NXOPEN直接录制一下导出STEP就可以了.录制出来自己挑需要的代码拿过来改一下. NX9+VS2012 #include <NXOpen/Part.hxx> #inc ...
随机推荐
- SQL关于:警告: 聚合或其他 SET 操作消除了空值。
方法一: create table tb ( id int, num int ) insert into tb select 1,10 insert into tb select 1,20 inser ...
- Add cast to是什么意思
eclipse中是强制类型转换的意思.
- Table边框合并
<style> table, table tr th, table tr td { border: 1px solid #0094ff; } table { width: 200px; m ...
- js 邮箱,手机电话验证
var mail=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; var tel=/^(\d3,4|\d{3,4} ...
- Array排序和List排序
public class SortTest { public static void main(String[] args) { int arr[]={12,4,45,23,5,7,9,33}; Sy ...
- 【基础】Pipeline
1. 参考的优秀文章 Request/Response protocols and RTT 2. 来源 原来,系统中一个树结构的数据来源是Redis,由于数据增多.业务复杂,查询速度并不快.究其原因, ...
- Sqli labs系列-less-1 详细篇
要说 SQL 注入学习,网上众多的靶场,就属 Sqli labs 这个系列挺不错的,关卡达到60多关了,我自己也就打了不几关,一个挺不错的练习SQL注入的源码. 我一开始就准备等我一些原理篇总结完了, ...
- chromedriver安装(谷歌浏览器驱动安装)
如果程序执行错误,浏览器没有打开,那么应该是没有装 Chrome 浏览器或者 Chrome 驱动没有配置在环境变量里.下载驱动,然后将驱动文件路径配置在环境变量即可. chromedriver下载地址 ...
- 20、formAdd,javascript实现动态添加
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- requests_html爬虫小练习
爬取豆瓣TOP250 from requests_html import HTMLSession #新建一个html文件,将相应的代码放入,运行查看结果,如果页面全部渲染则直接根据页面信息获得数据: ...