NX9+VS2012

     #include <uf.h>
#include <uf_obj.h>
#include <uf_modl.h>
#include <uf_part.h> UF_initialize(); //遍历当前显示部件所有体
std::vector<tag_t> SolidVector;
tag_t ObjectTag = NULL_TAG;
int Type, SubType, Body_Type;
int Count = ;
char msg[];
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_solid_type, &ObjectTag);
while (ObjectTag != NULL_TAG)
{
UF_OBJ_ask_type_and_subtype(ObjectTag, &Type, &SubType);
if (SubType == UF_solid_body_subtype)
{
UF_MODL_ask_body_type(ObjectTag, &Body_Type);
if (Body_Type == UF_MODL_SOLID_BODY)
{
UF_OBJ_set_color(ObjectTag, );
SolidVector.push_back(ObjectTag);
Count++;
}
}
UF_OBJ_cycle_objs_in_part(UF_PART_ask_display_part(), UF_solid_type, &ObjectTag);
} //求所有体的最大边界
double MaxBox[] = {, , , -, -, -};
for (int i = ; i < Count; i++)
{
double Box[];
UF_MODL_ask_bounding_box(SolidVector[i], Box);
MaxBox[] = MaxBox[] < Box[]? MaxBox[]:Box[];
MaxBox[] = MaxBox[] < Box[]? MaxBox[]:Box[];
MaxBox[] = MaxBox[] < Box[]? MaxBox[]:Box[];
MaxBox[] = MaxBox[] > Box[]? MaxBox[]:Box[];
MaxBox[] = MaxBox[] > Box[]? MaxBox[]:Box[];
MaxBox[] = MaxBox[] > Box[]? MaxBox[]:Box[];
} //转换
char Length[], Width[], Height[];
sprintf(Length, "%f", MaxBox[] - MaxBox[]);
sprintf(Width, "%f", MaxBox[] - MaxBox[]);
sprintf(Height, "%f", MaxBox[] - MaxBox[]); char* Len[];
Len[] = Length;
Len[] = Width;
Len[] = Height; //创建块
double Ori[] = {MaxBox[], MaxBox[], MaxBox[]};
tag_t BlkTag = NULL_TAG;
UF_MODL_create_block1(UF_NULLSIGN, Ori, Len, &BlkTag); //特征找体
tag_t BodyTag = NULL_TAG;
UF_MODL_ask_feat_body (BlkTag,&BodyTag); //设置透明度
UF_OBJ_set_translucency(BodyTag, ); UF_terminate();

NX二次开发-算法篇-创建最大边界包容盒的更多相关文章

  1. NX二次开发-算法篇-判断找到两个数组里不相同的对象

    NX9+VS2012 #include <uf.h> #include <uf_curve.h> #include <uf_modl.h> #include < ...

  2. NX二次开发-算法篇-vector函数排序(例子:遍历所有点并排序)

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_curve.h> #include <u ...

  3. NX二次开发-算法篇-冒泡排序(例子:遍历所有点并排序)

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_curve.h> #include <u ...

  4. NX二次开发-算法篇-随便找个不规则的体,找出面的中心点的Z坐标最高和最低的面,高亮显示

    NX9+VS2012 #include <uf.h> #include <uf_evalsf.h> #include <NXOpen/Body.hxx> #incl ...

  5. NX二次开发-算法篇-找相切面

    方法1:通过判断相邻面公共边的光顺性来找相切面 1 #include <uf.h> 2 #include <uf_modl.h> 3 #include <uf_obj.h ...

  6. NX二次开发-UFUN建模创建特征组UF_MODL_create_set_of_feature

    NX11+VS2013 #include <uf.h> #include <uf_modl.h> UF_initialize(); //创建块 UF_FEATURE_SIGN ...

  7. NX二次开发-通过数组创建矩阵

    函数:UF_CSYS_create_matrix() 函数说明:通过数组创建矩阵. 用法: #include <uf.h> #include <uf_csys.h> exter ...

  8. NX二次开发-UFUN获取面的内外边界UF_MODL_ask_loop_list_item

    NX11+VS2013 #include <uf.h> #include <uf_modl.h> #include <NXOpen/Face.hxx> #inclu ...

  9. NX二次开发-创建(临时)坐标系

    函数:UF_CSYS_create_csys() . UF_CSYS_create_temp_csys() 函数说明:创建坐标系 .创建临时坐标系 用法: #include <uf.h> ...

随机推荐

  1. 画PCB时检查点总结

    一.画原理图时 NPN的引脚是否对应.继电器的引脚是否对应 设计通信电路时,MCU_RX和通信芯片RS232的ROUT接.同理MCU_TX和RS232的TIN接. MCU最好留个外接晶振接口,用NPN ...

  2. Work 4(通知类) (2019.04.25)

  3. AngularJS 指令实践指南(一)

    指令(Directives)是所有AngularJS应用最重要的部分.尽管AngularJS已经提供了非常丰富的指令,但还是经常需要创建应用特定的指令.这篇教程会为你讲述如何自定义指令,以及介绍如何在 ...

  4. [NOIP模拟16]题解

    A.Blue 出题人大概已经去为国家处理积压子弹了? 贪心,让每一只青蛙(我怂行吧)都尽量往远跳,能到达的最远的被踩了就跳次远的,以此类推.可以维护一个单调队列,表示每只青蛙的位置(开始都是0).然后 ...

  5. vscode 编写Python走过的坑

    1,在使用vscode 中import turtle 这个模块, 再调用t = turtle.Pen(),始终提示无法找到turtle模块 2.可是使用terminal 中调用turtle模块,没有问 ...

  6. HIve分组查询返回每组的一条记录

    select a.lng,a.lat from (select row_number() over ( partition by uid,grid_id) as rnum,weighted_centr ...

  7. git分布式版本控制系统权威指南学习笔记(二):git add暂存区的三个状态以及暂存区的理解

    文章目录 不经过git add(到暂存区),能直接进行commit吗? 举个

  8. Jeecg 切换默认首页方法

    类名: org.jeecgframework.core.enums.SysThemesEnum

  9. vfs_path_lookup

    1: void lookupInode() 2: { 3: struct dentry* root_dentry; 4: struct vfsmount* root_mnt; 5: const cha ...

  10. JPA安装配置

    现在让我们继续安装JPA,如下几个步骤. 第一步:确认已经Java安装 首先,需要在系统上安装Java软件开发工具包(SDK).为了验证这一点,根据所使用的平台执行以下两个命令. 如果Java安装已正 ...