NX9+VS2012
//NX二次开发中常用拉伸函数为UF_MODL_create_extruded2,但是此函数不能拉伸片体,
//想要拉伸片体用函数UF_MODL_create_extruded。 #include <uf.h>
#include <uf_curve.h>
#include <uf_modl.h>
#include <uf_obj.h> UF_initialize(); //创建直线1
UF_CURVE_line_t LineCoords1;
LineCoords1.start_point[] = 0.0;
LineCoords1.start_point[] = 0.0;
LineCoords1.start_point[] = 0.0;
LineCoords1.end_point[] = 0.0;
LineCoords1.end_point[] = 100.0;
LineCoords1.end_point[] = 0.0;
tag_t LineTag[];
UF_CURVE_create_line(&LineCoords1, &LineTag[]); //创建直线2
UF_CURVE_line_t LineCoords2;
LineCoords2.start_point[] = 0.0;
LineCoords2.start_point[] = 100.0;
LineCoords2.start_point[] = 0.0;
LineCoords2.end_point[] = 100.0;
LineCoords2.end_point[] = 100.0;
LineCoords2.end_point[] = 0.0;
UF_CURVE_create_line(&LineCoords2, &LineTag[]); //创建直线3
UF_CURVE_line_t LineCoords3;
LineCoords3.start_point[] = 100.0;
LineCoords3.start_point[] = 100.0;
LineCoords3.start_point[] = 0.0;
LineCoords3.end_point[] = 100.0;
LineCoords3.end_point[] = 0.0;
LineCoords3.end_point[] = 0.0;
UF_CURVE_create_line(&LineCoords3, &LineTag[]); //创建直线4
UF_CURVE_line_t LineCoords4;
LineCoords4.start_point[] = 100.0;
LineCoords4.start_point[] = 0.0;
LineCoords4.start_point[] = 0.0;
LineCoords4.end_point[] = 0.0;
LineCoords4.end_point[] = 0.0;
LineCoords4.end_point[] = 0.0;
UF_CURVE_create_line(&LineCoords4, &LineTag[]); //创建链表
uf_list_p_t LineList;
UF_MODL_create_list(&LineList); //插入对象到链表
for (int i = ; i < ; i++)
{
UF_MODL_put_list_item(LineList, LineTag[i]);
} //函数1
//创建拉伸(UF_MODL_create_extruded2)
//备注:此函数不能做拉伸片体,只能拉伸封闭的线。拉伸片体用UF_MODL_create_extruded
char *TaperAngle = "0.0";
char *Limit[] = {"0.0", "50.0"};
double Point1[] = {0.0, 0.0, 0.0};
double Direction[] = {0.0, 0.0, 1.0};
UF_FEATURE_SIGN Sign = UF_NULLSIGN;
uf_list_p_t Features1;
UF_MODL_create_extruded2(LineList, TaperAngle, Limit, Point1, Direction, Sign, &Features1); //特征找体
tag_t BodyTag = NULL_TAG;
UF_MODL_ask_feat_body(Features1->eid, &BodyTag); //将拉伸设置成红色
UF_OBJ_set_color(BodyTag,); //释放内存
UF_MODL_delete_list(&LineList); //创建直线
UF_CURVE_line_t LineCoords5;
LineCoords5.start_point[] = 0.0;
LineCoords5.start_point[] = -10.0;
LineCoords5.start_point[] = 0.0;
LineCoords5.end_point[] = 0.0;
LineCoords5.end_point[] = -100.0;
LineCoords5.end_point[] = 0.0;
tag_t LineTag5 = NULL_TAG;
UF_CURVE_create_line(&LineCoords5, &LineTag5); //创建链表
uf_list_p_t LineList1;
UF_MODL_create_list(&LineList1); //插入对象到链表
UF_MODL_put_list_item(LineList1, LineTag5); //函数2
//创建拉伸(UF_MODL_create_extruded)
char *TaperAngle1 = "0.0";
char *Limit1[] = {"0.0", "50.0"};
double Point2[] = {0.0, 0.0, 0.0};
double Direction1[] = {0.0, 0.0, 1.0};
UF_FEATURE_SIGN Sign1 = UF_NULLSIGN;
uf_list_p_t Features2;
UF_MODL_create_extruded(LineList1, TaperAngle1, Limit1, Point2, Direction1, Sign1, &Features2); //特征找体
tag_t BodyTag1 = NULL_TAG;
UF_MODL_ask_feat_body(Features2->eid, &BodyTag1); //将拉伸设置成蓝色
UF_OBJ_set_color(BodyTag1,); //释放内存
UF_MODL_delete_list(&LineList1); UF_terminate();

NX二次开发-UFUN拉伸函数UF_MODL_create_extruded的更多相关文章

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

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

  2. NX二次开发-UFUN发射线函数UF_MODL_trace_a_ray的用法

    今天是国庆节,放假休息懒得动,没有出去玩,在家研究一下发射线函数UF_MODL_trace_a_ray.小弟以前在软件公司混的时候,当时我做的那个项目就用到了UF_MODL_trace_a_ray,当 ...

  3. NX二次开发-UFUN计时函数UF_begin_timer

    NX9+VS2012 #include <uf.h> #include <uf_modl.h> UF_initialize(); //计时开始 UF_timer_t Timer ...

  4. NX二次开发-UFUN计时函数UF_end_timer

    1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 6 7 UF_initialize(); 8 9 //计时开 ...

  5. NX二次开发-UFUN遍历函数UF_OBJ_cycle_objs_in_part

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

  6. NX二次开发-UFUN遍历函数UF_OBJ_cycle_all

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

  7. 【NX二次开发】拉伸面、拉伸封闭曲线成片体UF_MODL_create_extrusion

    用那几个拉伸,不能将封闭的曲线拉伸成片体,用UF_MODL_create_extrusion函数是可以的,下面是例子. 帮助上说拉伸片体不能有拔模角度,应该是错误的,下面是一个封闭曲线带拔模角度拉伸片 ...

  8. NX二次开发-UFUN将工程图转成CGM和PDF文件UF_CGM_export_cgm

    文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...

  9. NX二次开发-UFUN获取NX系统默认导出CGM的选项设置UF_CGM_ask_default_export_options

    文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...

随机推荐

  1. nginx自动切割日志脚本

    #!/bin/bash savepath_log='/data/logs' nglogs='/data/logs' mkdir -p $savepath_log/$(date +%Y)/$(date ...

  2. sql 合并查询结果

    在使用js报表工具的时候,常常需要提供json数据进行显示, 在sql查询的时候就需要构造合适的查询结果出来; 就用到了合并两个没有关联关系的表数据, SELECT SUM(a1.amount) AS ...

  3. Python删除文件夹

    import os os.rmdir('OS-Demo-2') os.removedirs('OS-Demo-3/sub-Dir-1') os.removedirs()会自动将上一级文件夹也删除,谨慎 ...

  4. spring boot 与微服务之间的关系

    Spring Boot 和微服务没关系, Java 微服务治理框架普遍用的是 Spring Cloud. Spring Boot 产生的背景,是开发人员对 Spring 框架越来越复杂的配置吐槽越来越 ...

  5. Fatal error: Call to a member function on a non-object 的2种解决办法

    这两天被一个莫名其妙的错误:Fatal error: Call to a member function on a non-object in d://www/htdocs/inc.php 77  搞 ...

  6. 使用SpringBoot AOP 记录操作日志、异常日志

    平时我们在做项目时经常需要对一些重要功能操作记录日志,方便以后跟踪是谁在操作此功能:我们在操作某些功能时也有可能会发生异常,但是每次发生异常要定位原因我们都要到服务器去查询日志才能找到,而且也不能对发 ...

  7. AcWing 157. 树形地铁系统 (hash判断树同构)打卡

    一些主要城市拥有树形的地铁系统,即在任何一对车站之间,有且只有一种方式可以乘坐地铁. 此外,这些城市大多数都有一个中央车站. 想象一下,你是一名在拥有树形地铁系统的城市游玩的游客,你想探索该城市完整的 ...

  8. django_websocket实现简单聊天室

    一.安装模块 pip install channels pip install channels-redis 二.代码 #websocket_v1/settings.py INSTALLED_APPS ...

  9. 【C#技术】一篇文章搞掂:LLBL

    公司代码速查 ParameterBase.CurrentUser.UserId ICustomerDeskDetailManager customerDeskDetailManager = Clien ...

  10. “今日头条杯”首届湖北省大学程序设计竞赛--F. Flower Road

    题目链接:点这 github链接:(包含数据和代码,题解):点这 链接:https://www.nowcoder.com/acm/contest/104/E来源:牛客网 题目描述 (受限于评测机,此题 ...