随笔分类 -  NX二次开发

摘要:代码: double douOriginPoint[3] = { 0, 0, 5 }; double douPlaneNormal[3] = { 0, 0, 1 }; tag_t tagPlane = NULL_TAG; UF_MODL_create_fixed_dplane(douOriginPo 阅读全文
posted @ 2022-09-10 22:21 王牌飞行员_里海 阅读(124) 评论(0) 推荐(0) 编辑
摘要:两点之间的距离公式: 源码: //获得平面上2点距离 double getPointToPointDis(double p1[2],double p2[2]) { return sqrt((p1[0]-p2[0])*(p1[0]-p2[0])+(p1[1]-p2[1])*(p1[1]-p2[1])) 阅读全文
posted @ 2022-08-27 15:20 王牌飞行员_里海 阅读(182) 评论(0) 推荐(0) 编辑
摘要:显示一个临时文本的例子: (刷新后消失) 源码: #include "me.hpp" # include "NXOpen\NXString.hxx" extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_in 阅读全文
posted @ 2022-08-15 15:29 王牌飞行员_里海 阅读(469) 评论(1) 推荐(0) 编辑
摘要:UF_DISP_ask_color 阅读全文
posted @ 2022-08-11 19:58 王牌飞行员_里海 阅读(262) 评论(0) 推荐(0) 编辑
摘要:效果: 源码: vector<NXOpen::TaggedObject *> vecObj = this->selection0->GetSelectedObjects(); if (vecObj.size() == 2) { tag_t tagTarget = vecObj[0]->Tag(); 阅读全文
posted @ 2022-08-09 13:05 王牌飞行员_里海 阅读(286) 评论(0) 推荐(0) 编辑
摘要:int init_proc_face(UF_UI_selection_p_t select, void* user_data) { int num_triples = 1; UF_UI_mask_t mask_triples[] = { UF_solid_type,0,20 }; if (UF_UI 阅读全文
posted @ 2022-08-05 17:52 王牌飞行员_里海 阅读(140) 评论(0) 推荐(0) 编辑
摘要:也可用于获取PMI的尺寸值 源码: #include "me.hpp" int doJob(); extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); doJob(); UF_te 阅读全文
posted @ 2022-07-20 10:30 王牌飞行员_里海 阅读(646) 评论(0) 推荐(0) 编辑
摘要:镜像体特征 int doWork() { //创建块 UF_FEATURE_SIGN sign = UF_NULLSIGN;//设置布尔 double douPt[3] = { 0.0, 0.0, 0.0 };//设置原点 char *cEdgeLen[3] = { "100", "100", "1 阅读全文
posted @ 2022-07-01 10:07 王牌飞行员_里海 阅读(99) 评论(0) 推荐(0) 编辑
摘要:分割体 int doWork() { //创建block UF_FEATURE_SIGN sign = UF_NULLSIGN; double douPt[3] = { 0.0, 0.0, 0.0 }; char *Edge_Len[3] = { "99", "98", "97.1256" }; t 阅读全文
posted @ 2022-07-01 09:50 王牌飞行员_里海 阅读(96) 评论(0) 推荐(0) 编辑
摘要:问题:使用ufun拆分体后丢失面的颜色 方案:用NXOpen的分割可以保留颜色。 阅读全文
posted @ 2022-06-30 11:45 王牌飞行员_里海 阅读(71) 评论(0) 推荐(0) 编辑
摘要:【NX二次开发】用代码修改BLOCK UI对话框的标题 阅读全文
posted @ 2022-06-22 15:33 王牌飞行员_里海 阅读(104) 评论(0) 推荐(0) 编辑
摘要:注意,需要先从首选项中设置背景为“纯色” 代码 int setBackgroundColor(int iR, int iG, int iB) { double clr_values[3]; clr_values[0] = iR / 255.0; clr_values[1] = iG / 255.0; 阅读全文
posted @ 2022-06-19 18:01 王牌飞行员_里海 阅读(213) 评论(0) 推荐(0) 编辑
摘要:单位化向量 #include "me.hpp" extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); double douV[3] = { 0,2,2 }; double douU 阅读全文
posted @ 2022-06-18 16:03 王牌飞行员_里海 阅读(73) 评论(0) 推荐(0) 编辑
摘要:获取体的面 int getBodyFaces(tag_t tagBody, int iType, vector<tag_t> *vecFaces) { uf_list_p_t list1 = NULL; UF_MODL_create_list(&list1); double douFaceBox[6 阅读全文
posted @ 2022-06-17 14:19 王牌飞行员_里海 阅读(191) 评论(0) 推荐(0) 编辑
摘要:分享一种判断圆柱面是不是孔的方法。 如下图所示体上有三个圆柱面,2个孔和1个R角面。可以通过面的边的组数(loop)判断圆柱面是不是孔。孔的loop至少有2个。 代码: //获取面上loop的数量 int getFaceLooscount(tag_t tagFace) { uf_loop_t *lo 阅读全文
posted @ 2022-06-17 10:14 王牌飞行员_里海 阅读(241) 评论(0) 推荐(0) 编辑
摘要:char *cSysLog; UF_ask_syslog_filename(&cSysLog); string strSysLog = cSysLog; print("%s\n", strSysLog.c_str()); UF_free(cSysLog); 阅读全文
posted @ 2022-06-08 15:06 王牌飞行员_里海 阅读(98) 评论(0) 推荐(0) 编辑
摘要:效果: 源码: #include <uf.h> #include <uf_ui.h> extern DllExport void ufusr(char *param, int *returnCode, int rlen) { UF_initialize(); char* release; UF_ge 阅读全文
posted @ 2021-08-02 11:13 王牌飞行员_里海 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Open C uc4400uc4403uc4404uc4406uc4409uf3192uf4401uf4402UF_add_callback_functionUF_allocate_memoryUF_ask_application_moduleUF_ask_codesetUF_ask_grip_ar 阅读全文
posted @ 2021-04-06 11:48 王牌飞行员_里海 阅读(384) 评论(0) 推荐(0) 编辑
摘要:两点式直线与平面交点 /** * Brief: 直线与平面的交点 * Overview: 直线(两点式方程)与平面的交点 * Param: * douLineStart 输入直线起点 * douLineEnd 输入直线终点 * douPlanePoint 输入面上的点 * douPlaneVecto 阅读全文
posted @ 2021-03-26 09:39 王牌飞行员_里海 阅读(158) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示