NX11+VS2013

 #include <uf.h>
#include <uf_disp.h>
#include <uf_modl.h>
#include <uf_part.h>
#include <uf_obj.h>
#include <uf_assem.h>
#include <uf_ui.h>
#include <string.h>
#include <NXOpen/NXObjectManager.hxx>
#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Assemblies_Component.hxx>
#include <NXOpen/Assemblies_ComponentAssembly.hxx>
#include <NXOpen/BasePart.hxx>
#include <NXOpen/MenuBar_ContextMenuProperties.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/PartLoadStatus.hxx>
#include <NXOpen/Selection.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/TaggedObject.hxx>
#include <algorithm>
#include <NXOpen/STLCreator.hxx>
#include <NXOpen/DexManager.hxx>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <iterator>
#include <cctype> void MyClass::CycleComponent()
{
//遍历当前part所有component
tag_t ComponentTag = NULL_TAG;
UF_OBJ_cycle_objs_in_part(UF_ASSEM_ask_work_part(), UF_component_type, &ComponentTag);
while (ComponentTag != NULL_TAG)
{
//获的显示的体
UF_OBJ_disp_props_t Componentdisp_props;
UF_OBJ_ask_display_properties(ComponentTag, &Componentdisp_props);
int ComponentBlank = Componentdisp_props.blank_status;
if (ComponentBlank == UF_OBJ_NOT_BLANKED)
{
//把装配子部件设置成工作部件
NXOpen::Assemblies::Component *component1(dynamic_cast<NXOpen::Assemblies::Component *>(NXOpen::NXObjectManager::Get(ComponentTag)));
NXOpen::PartLoadStatus *partLoadStatus1;
theSession->Parts()->SetWorkComponent(component1, NXOpen::PartCollection::RefsetOptionEntire, NXOpen::PartCollection::WorkComponentOptionVisible, &partLoadStatus1);
workPart = theSession->Parts()->Work();
delete partLoadStatus1; //遍历工作部件里的体
CycleComponentBody(); //恢复到装配部件
NXOpen::Assemblies::Component *nullNXOpen_Assemblies_Component(NULL);
NXOpen::PartLoadStatus *partLoadStatus2;
theSession->Parts()->SetWorkComponent(nullNXOpen_Assemblies_Component, NXOpen::PartCollection::RefsetOptionEntire, NXOpen::PartCollection::WorkComponentOptionVisible, &partLoadStatus2);
workPart = theSession->Parts()->Work();
delete partLoadStatus2;
} UF_OBJ_cycle_objs_in_part(UF_ASSEM_ask_work_part(), UF_component_type, &ComponentTag);
} }

NX二次开发-遍历当前part所有component,把装配子部件设置成工作部件的更多相关文章

  1. NX二次开发-基于MFC界面的NX对Excel读写操作(OLE方式(COM组件))

    NX二次开发API里没有对EXCAL读写操作的相关函数,市面上有很多种方法去实现,比如UFUN调KF,ODBC,OLE(COM组件)等等.这里我是用的OLE(COM组件)方式去做的,这种在VC上创建的 ...

  2. NX二次开发-基于NX开发向导模板的NX对Excel读写操作(OLE方式(COM组件))

    在看这个博客前,请读者先去完整看完:NX二次开发-基于MFC界面的NX对Excel读写操作(OLE方式(COM组件))https://ufun-nxopen.blog.csdn.net/article ...

  3. NX二次开发-Block UI C++界面关于 在Block UI中UF_initialize();和UF_terminate();的使用

    关于 在Block UI中UF_initialize();和UF_terminate();的使用 用Block UI作NX二次开发的时候,不需要在使用UFUN函数的时候加UF_initialize() ...

  4. NX二次开发-基于MFC界面对话框与NX交互的开发

    打开VS2013 点击新建,选择MFC DLL 点击确定 点下一步 什么都不改,直接点完成 进来之后先编译一下,看是否编译成功 打开项目属性,更改这几处 $(UGII_BASE_DIR)\ugopen ...

  5. NX二次开发-BlockUI对话框嵌套MFC对话框制作进度条

    半年前在一些QQ群看到有大神NX二次开发做出了进度条,那个时候我还不会弄,也不知道怎么弄得,后来断断续续得研究了一下,直到今天我把它做出来了.内心还是很喜悦的!回想自己这两年当初从没公司肯给我做NX二 ...

  6. NX二次开发-UDO用户自定义对象(UFUN)【持续完善】

    每当提起UDO总是会让我想起大专毕业那会失业找工作,后来有个宝贵机会去了软件公司上班,拿到了我人生中的第一个NX二次开发项目,一个关于测量汽车前后左右摄像头的项目.当时那个项目就用到了UDO,对于只看 ...

  7. NX二次开发-UFUN计算两点距离UF_VEC3_distance

    NX11+VS2013 #include <uf.h> #include <uf_curve.h> #include <uf_vec.h> UF_initializ ...

  8. NX二次开发-UFUN拉伸函数UF_MODL_create_extruded

    NX9+VS2012 //NX二次开发中常用拉伸函数为UF_MODL_create_extruded2,但是此函数不能拉伸片体, //想要拉伸片体用函数UF_MODL_create_extruded. ...

  9. NX二次开发-UFUN拉伸函数UF_MODL_create_extruded2

    NX9+VS2012 //NX二次开发中常用拉伸函数为UF_MODL_create_extruded2,但是此函数不能拉伸片体, //想要拉伸片体用函数UF_MODL_create_extruded. ...

随机推荐

  1. 08-03-re-模块

    一组特殊符号组成的表达式,用于描述某种规则.该应用场景生活中随处可见. ​ 例如:让有志青年过上体面的生活,这里面就由规则,即有志青年. 正则表达式的作用,以及使用场景 ​ 1.用于从字符串中匹配满足 ...

  2. Vue学习笔记【19】——Vue中的动画(使用第三方 CSS 动画库)

    导入动画类库:  <link rel="stylesheet" type="text/css" href="./lib/animate.css& ...

  3. iOS导航栏的背景颜色设置

    方法一: (1) self.navigationController.navigationBar.barStyle = UIBarStyleDefault; self.navigationContro ...

  4. 远程仓库 GitHub

    远程仓库 这里介绍的远程仓库指的是 GitHub, 在这个网站,所有非私有的的代码,都可以被其他人查看,所以,一些机密或者重要的文件千万不要上传到这里面,如果需要可以购买付费版本或自己公司搭建埃及的远 ...

  5. APICloud框架——获取本地图片信息

    api.getPicture 获取本地图片放置到服务器上或者在app中预览是app的基本功能,今天使用了APICloud框架的api.getPicture这个api获取到的本地图片预览在app中,就像 ...

  6. 把sublime添加到右键快捷菜单

    方法一: 新建sublime_addright.reg文件 编辑后双击打开就OK 括号内是sublime安装路径:使用的时候去掉括号 open sublimeText3 是提示文字 Windows R ...

  7. 【Flutter学习】基本组件之基本网格Gradview组件

    一,概述 数据量很大的时用矩阵方式排列比较清晰,此时用网格列表组件,即为GridView组件,可实现多行多列的应用场景. 使用GridView创建网格列表有多种方式: GridView.count 通 ...

  8. (3)Redis conifg

    redis.windows-service.conf      Redis-x64-3.2.100 # Redis configuration file example # Note on units ...

  9. vue2.0使用基础

    开发情况下需要引入vue.js和vue-resource.js,el:dom生效范围,data,dom静态数据,mounted:初始化调用方法,注意,官方文档需要添加this.$nextTict(fu ...

  10. 剑指offer——60二叉树的深度

    题目描述 输入一棵二叉树,求该树的深度.从根结点到叶结点依次经过的结点(含根.叶结点)形成树的一条路径,最长路径的长度为树的深度.   题解: 简单的深度遍历即可.   class Solution ...