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二次开发-UFUN求对象的最大边界框UF_MODL_ask_bounding_box的更多相关文章

  1. NX二次开发-UFUN求两个对象最短距离UF_MODL_ask_minimum_dist

    NX9+VS2012 #include <uf.h> #include <uf_modl.h> #include <uf_ui.h> UF_initialize() ...

  2. NX二次开发-UFUN高亮显示对象UF_DISP_set_highlight

    NX11+VS2013 #include <uf.h> #include <uf_modl.h> #include <uf_disp.h> UF_initializ ...

  3. NX二次开发-UFUN查询对象的类型和子类型UF_OBJ_ask_type_and_subtype

    NX9+VS2012 #include <uf.h> #include <uf_obj.h> #include <uf_modl.h> #include <u ...

  4. NX二次开发-UFUN获取对象的显示属性(图层,颜色,空白状态,线宽,字体,高亮状态)UF_OBJ_ask_display_properties

    NX9+VS2012 #include <uf.h> #include <uf_modl.h> #include <uf_obj.h> UF_initialize( ...

  5. NX二次开发-UFUN求两个向量的叉乘UF_VEC3_cross

    NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_vec.h> #include <uf_ ...

  6. NX二次开发-UFUN所有对象类型的宏定义

    /**************************************************************************** Copyright (c) 2010 Sie ...

  7. NX二次开发-UFUN设置对象线型UF_OBJ_set_font

    #include <uf.h> #include <uf_modl.h> #include <uf_obj.h> UF_initialize(); //创建块 UF ...

  8. NX二次开发-UFUN输入对象tag获得part名字UF_OBJ_ask_owning_part

    NX11+VS2013 #include <uf.h> #include <uf_modl.h> #include <uf_part.h> #include < ...

  9. NX二次开发-UFUN获取图纸视图最大边界和视图中心点UF_DRAW_ask_view_borders

    NX9+VS2012 //获得视图的最大边界 ]; UF_DRAW_ask_view_borders(view_tag[j], view_borders); //获得视图原点 ]; ViewOrigi ...

随机推荐

  1. ansible-继续普通用户权限运行

    ansible 远程以普通用户执行命令   1. ansible 10.0.0.1 -m raw -a "date" -u www 2.在ansible的主机配置文件中指定ssh_ ...

  2. Oracle系列教程之一软件安装与卸载

    1.安装软件 软件下载地址:https://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/index.html ...

  3. Unity Download

    { https://unity.cn/releases }

  4. 启动php-fpm和nginx

    /usr/local/php/sbin/php-fpm #手动打补丁的启动方式/usr/local/php/sbin/php-fpm start sudo /usr/local/nginx/nginx ...

  5. CSS Id 和 Class

    id 和 class 选择器 如果你要在HTML元素中设置CSS样式,你需要在元素中设置"id" 和 "class"选择器.直线电机哪家好 id 选择器 id ...

  6. 排序+并查集——cf1213F

    /* 有向边(pi,pi+1),形成链后进行dfs,求出dfs序 一个联通块内的元素必须是同一个字符,如果最后的联通块个数<k,说明不行 */ #include<bits/stdc++.h ...

  7. C语言新手写扫雷攻略3

    界面绘制好后,雷数也布置了,接下来就是游戏的运行过程了,今天先不说具体过程,再来看看需要用到的辅助函数 先是简单的画红旗,鼠标右键的功能是画红旗,至此我们都是在使用函数自己绘图,效率是低,但有助于理解 ...

  8. angulajs 详解 directive 中 的 scope 概念

    Directive 是 angularjs 中最重要的概念,我的理解就是自定义html tag, 这个自定的tag 浏览器不会解析,会有angularjs 来动态解析. 比如在html 中添加 < ...

  9. 工具类--MD5Utils

    public class MD5Utils { private static final String[] HEX_DIGITS = { "0", "1", & ...

  10. c#网络通信框架networkcomms内核解析之一 消息传送2

    networkcomms.net 来自英国的网络通信框架 官方网址 www.networkcomms.net 中文网址www.networkcomms.cn 在网络通信程序中,本地的类或者对象,要传输 ...