NX二次开发-UF_MODL_intersect_objects获取两个对象的交点
NX9+VS2012
#include <uf.h>
#include <uf_curve.h>
#include <uf_modl.h>
#include <uf_ui.h>
UF_initialize();
//创建直线
UF_CURVE_line_t LineCoods1;
LineCoods1.start_point[] = 0.0;
LineCoods1.start_point[] = 0.0;
LineCoods1.start_point[] = 20.0;
LineCoods1.end_point[] = 100.0;
LineCoods1.end_point[] = 100.0;
LineCoods1.end_point[] = 100.0;
tag_t Line1Tag = NULL_TAG;
UF_CURVE_create_line(&LineCoods1, &Line1Tag);
UF_CURVE_line_t LineCoods2;
LineCoods2.start_point[] = 50.0;
LineCoods2.start_point[] = 50.0;
LineCoods2.start_point[] = 0.0;
LineCoods2.end_point[] = -50.0;
LineCoods2.end_point[] = -50.0;
LineCoods2.end_point[] = 100.0;
tag_t Line2Tag = NULL_TAG;
UF_CURVE_create_line(&LineCoods2, &Line2Tag);
int IntersectionsNum;
UF_MODL_intersect_info_p_t * Intersections;
UF_MODL_intersect_objects(Line1Tag, Line2Tag, 0.01, &IntersectionsNum, &Intersections);//输入两个对象tag,找交点
double IntersectionsPoint[];//交点坐标
for (int i = ; i < IntersectionsNum; i++)
{
int type = Intersections[i]->intersect_type;
if (type == UF_MODL_INTERSECT_POINT)
{
IntersectionsPoint[] = Intersections[i]->intersect.point.coords[];
IntersectionsPoint[] = Intersections[i]->intersect.point.coords[];
IntersectionsPoint[] = Intersections[i]->intersect.point.coords[];
}
}
//打印
char msg[];
sprintf_s(msg, "X坐标:%f\nY坐标:%f\nZ坐标:%f\n", IntersectionsPoint[], IntersectionsPoint[], IntersectionsPoint[]);
UF_UI_open_listing_window();
UF_UI_write_listing_window(msg);
//释放
UF_free(Intersections);
UF_terminate();

NX二次开发-UF_MODL_intersect_objects获取两个对象的交点的更多相关文章
- NX二次开发-UFUN求两个对象最短距离UF_MODL_ask_minimum_dist
NX9+VS2012 #include <uf.h> #include <uf_modl.h> #include <uf_ui.h> UF_initialize() ...
- 【NX二次开发】获取两个面之间的所有面
已知两个蓝色面,使用遍历面的方法求紫色面.算法例子: 1 bool is_NeighborFace(tag_t tagFace1, tag_t tagFace2) 2 { 3 vector<ta ...
- NX二次开发-UFUN获取NX系统默认导出CGM的选项设置UF_CGM_ask_default_export_options
文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...
- NX二次开发-UFUN获取当前导出CGM选项设置UF_CGM_ask_session_export_options
文章转载自唐康林NX二次开发论坛,原文出处: http://www.nxopen.cn/thread-126-1-1.html 刚才有同学问到这个问题,如果是用NXOpen来做,直接录制一下就可以了: ...
- 【NX二次开发】获取指定矩阵标识的矩阵值
函数:UF_CSYS_ask_matrix_values () 函数说明:获取指定矩阵标识的矩阵值. 用法: #include <uf.h> #include <uf_csys.h& ...
- 【NX二次开发】获取当前鼠标选择的对象 UF_UI_ask_global_sel_object_list
先选择多个对象object,然后使用此函数获取选择的对象的tag,最后就可以使用object的一些函数了. ufun例子: extern DllExport void ufusr(char *parm ...
- NX二次开发-UFUN获取系统相关信息UF_ask_system_info
NX9+VS2012 #include <uf.h> UF_initialize(); UF_system_info_t Info; UF_ask_system_info(&Inf ...
- 【NX二次开发】 获取产品曲面上多个点对应的面的垂直矢量!
说明:选择一个产品面,选择面上的点,生成点在此面上的法线反向,生成直线.生成矢量的起点坐标,和矢量方向信息.可用于三坐标测量,如果需要可以自己编个插件用! 效果图: 源码: //----------- ...
- NX二次开发-UFUN获取直线的两个端点UF_CURVE_ask_line_data
NX9+VS2012 #include <uf.h> #include <uf_obj.h> #include <uf_ui.h> UF_initialize(); ...
随机推荐
- Windows cmd 打开面板
{ 打开控制面板的命令是:“control” 打开控制面板 命令: rundll32.exe shell32.dll,Control_RunDLL 结果: 显示控制面板窗口. 例子: Cal ...
- Windows 获取windows密码
#include <iostream> #define Main main #define COLOR_GREEN system("color 2"); #includ ...
- magento 多域名多店
在magento1.4中请参考官网 :http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-dom ...
- Delphi 窗体函数 ShowScrollBar 控制滚动条
API函数 函数来源:FUNCTION ulong ShowScrollBar(ulong hwnd,ulong wBar,ulong bShow) LIBRARY "user32.dll& ...
- Comet Contest#11 F arewell(DAG计数+FWT子集卷积)
传送门. 题解: 4月YY集训时做过DAG计数,和这个基本上是一样的,但是当时好像直接暴力子集卷积,不然我省选时不至于不会,这个就多了个边不选的概率和子集卷积. DAG计数是个套路来的,利用的是DAG ...
- NX二次开发-使用MFC对话框不能用UF_UI_select等函数解决方法
VC/MFC调用UG Dialog要进入加锁状态 加锁 UF_UI_lock_ug_access ( UF_UI_FROM_CUSTOM ); 此处为UF_UI_select的函数 解锁 UF_UI_ ...
- (转)OpenFire源码学习之十四:插件管理
转:http://blog.csdn.net/huwenfeng_2011/article/details/43418433 Plugin管理 Openfire把插件模块加入到容器分为以下步骤: l ...
- IDM自定义报错页面
由于用户两次重复单点登录会跳转至原生态ORACLE的错误页面页面.请提供配置方法.原因:是由于重复登录导致的.解决方案:Oracle官方给出了具体的解决方案,具体如下:I.创建战争档案a.创建目录&q ...
- Openstack组件部署 — Networking service_安装并配置Controller Node
目录 目录 前文列表 前提条件 网络环境 完成下面的步骤以创建数据库 创建service credentials服务凭证 创建Neutron的API Endpoints 配置自服务网络 安装网络组件 ...
- input checkbox 禁止选中/修改
input checkbox 禁止选中 <input type="checkbox" onclick="return false;" /> inp ...