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. 决策树(Decision Tree)算法 python简单实现

    "" """ import numpy as np from math import log import operator import json ...

  2. C之输入输出函数(3) -- 请使用sscanf()

    #include <stdio.h> int fscanf(FILE *__restrict__stream, const char *__restrict__format-string, ...

  3. 使用springBoot和mybatis整合时出现如下错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方案

    在pom.xml文件中添加如下: <build>        <resources>            <resource>                & ...

  4. xml配置离线约束的目的和ecplipse离线约束配置

    正常情况下如果电脑已经联网的情况下,Spring的核心配置文件编写内容的时候是可以自动提示的,假设电脑如果离线情况下想要自动提示的话,就得配置离线约束文件. https://blog.csdn.net ...

  5. Apache解析漏洞复现(CVE-2017-15715),可以绕过黑名单

    照着P神的文章准备复现一下(总结一下经验) 环境的安装 这里面直接使用的vulhub里面的环境来进行安装的(为了方便吗) 基础环境如下    实际上Apache版本在2.4.0~2.4.29即可 i ...

  6. python内置模块-random

    print(random.randint(1,10)) 生成随机整数,下限必须小于上限print(random.randrange(1,10)) 生成随机整数,参数为([start],stop,[st ...

  7. XSS的原理分析与解剖(第二篇)

    0×01 前言: 上节(http://www.freebuf.com/articles/web/40520.html)已经说明了xss的原理及不同环境的构造方法.本期来说说XSS的分类及挖掘方法. 当 ...

  8. drag事件

    <!DOCTYPE HTML><html>  <head>      <title>拖动事件</title>    <style> ...

  9. LIBRARY_PATH是编译时候用的,LD_LIBRARY_PATH是程序运行是使用的

    LD_LIBRARY_PATH与LIBRARY_PATH的区别 看起来很像,但是完全是两码事. LIBRARY_PATH is used by gcc before compilation to se ...

  10. Bootstrap 避免模态框在用户点击背景空白处时,会自动关闭。

    问题: Bootstrap 模态框在用户点击背景空白处时,会自动关闭. 解决方法: 在HTML页面中编写模态框时,在div初始化时添加属性 aria-hidden=”true” data-backdr ...