你好,欢迎来到UG二次开发专业技术交流论坛! 会员登录 | 快速注册 | 忘记密码?
UG二次开发最新技术资料
  • UG GRIP中&DLGDIR用法

    发布者:qxglove 查看次数:36 评论条数:0 发布时间:2017-9-14
    UGGRIP中&DLGDIR用法?如何定义后处理的路径?
  • 选择过滤器设置

    发布者:liu_guangqun 查看次数:107 评论条数:0 发布时间:2017-8-25
    请问如何设置有出来选择相切面这个下拉菜单
  • 求助:uf读写excel

    发布者:一颗菜 查看次数:198 评论条数:5 发布时间:2017-7-27
    论坛前辈有mfc读写excel方面的详细教程吗?或者mfc做开发的入门教程也行
  • 点击查看GRIP全套视频教程
  • 请教一下SNAP的拉伸(extrude)如何做

    发布者:tingfgg 查看次数:436 评论条数:3 发布时间:2017-5-23
    研究了好几天,发现用SNAP开发的人比较少,资料难求!问题来了三维数模里存在一根多段封闭的线,用UI选择选中后,如何把选中的线作为参数在拉伸(extrude)命令里使用。求帮忙。谢谢各位师傅!
  • 调整圆角的大小

    发布者:qinyangliang 查看次数:421 评论条数:0 发布时间:2017-5-5
    各位师傅,谁知道同步建模里的(调整圆角的大小)的函数是哪个啊?先谢谢了!
  • grip提取实体的坐标信息

    发布者:naughtiness 查看次数:689 评论条数:1 发布时间:2017-4-4
    可否二次开发实现对UG模型的坐标信息提取呢
  • tag值的获取

    发布者:xiaotangcai 查看次数:826 评论条数:2 发布时间:2017-3-27
    新版ui界面,如何获取选择对象的tag值,比如选择一个曲线,怎么获取它的tag值
  • 点击查看VIP会员特权
  • 怎样根据一个矩阵和角度获取旋转后的矩阵?

    发布者:jjajiao 查看次数:725 评论条数:1 发布时间:2017-3-6
    怎样根据一个矩阵和输入的旋转角度获取旋转后的矩阵?
  • UF_SF_create_load_nx和UF_SF_create_bc_nx为啥在NX8.0时不见了

    发布者:dongzhe2009 查看次数:740 评论条数:0 发布时间:2017-1-18
    UF_SF_create_load_nx和UF_SF_create_bc_nx为啥在NX8.0时不见了
  • nx8.0程序怎样添加载荷和边界条件

    发布者:dongzhe2009 查看次数:701 评论条数:0 发布时间:2017-1-18
    nx8.0程序怎样添加载荷和边界条件
  • 求snap函数中文版

    发布者:zdhzdhzdh 查看次数:787 评论条数:1 发布时间:2017-1-14
    求大神给个snap函数中文版学习一下
  • 点击查看SNAP技术资料
  • 全部显示所有

    发布者:qinyangliang 查看次数:722 评论条数:1 发布时间:2017-1-11
    请问为什么用:unblnk/all做的二次开发不能显示所有打开的图层上的体呢,只能显示一部分,不知道什么原因
  • 自动打印

    发布者:q1355188058 查看次数:833 评论条数:11 发布时间:2017-1-11
    intPrintPart(tag_tInPart){UF_PART_set_display_part(InPart);UF_ASSEM_set_work_part(InPart);TagLtagAllSheets;intType,SubType;tag_tCurObj=NULL_TAG;//遍歷找出所有的圖紙UF_OBJ_cycle_objs_in_part(InPart,UF_drawing_type,&CurObj);while(CurObj){  UF_OBJ_ask_type_and_subtype(CurObj,&Type,&SubType);    UF_OBJ_cycle_objs_in_part(InPart,UF_drawing_type,&CurObj);}UF_PLOT_job_options_tJobOptions;UF_PLOT_banner_options_tBannerOptions;//旗幟,通欄頭號標題TCHAR*JobName;intCount=1;//tag_tdrawing_sheet;UF_CALL(UF_PLOT_ask_default_job_options(&JobOptions));//查询默认的打印任务选项,线宽设置等UF_CALL(UF_PLOT_ask_default_banner_options(&BannerOptions));UF_DRAW_info_tDrawInfo;TCHARProfile[S257];tagAllSheets.tmp=tagAllSheets.first;while(tagAllSheets.tmp){  UF_DRAW_ask_drawing_info(tagAllSheets.tmp->ent,&DrawInfo);    switch(DrawInfo.size_state)//確定使用哪一個打印配置  {  default:  caseUF_DRAW_METRIC_SIZE:  switch(DrawInfo.size.metric_size_code)  {  default:  caseUF_DRAW_A4:    strcpy_s(Profile,"A4_h");//h表示橫向幫使用者配置好  配置檔A4_h專用於A4紙張的打印    break;  caseUF_DRAW_A3:    strcpy_s(Profile,"A3_h");//幫使用者配置好  配置檔A3_h專用於A3紙張的打印    break;  caseUF_DRAW_A2:    strcpy_s(Profile,"A2_h");    break;  caseUF_DRAW_A1:    strcpy_s(Profile,"A1_h");    break;  caseUF_DRAW_A0:    strcpy_s(Profile,"A0_h");    break;  }  break;  caseUF_DRAW_ENGLISH_SIZE:  tagAllSheets.tmp=tagAllSheets.tmp->Next;//目前還不處理英制圖紙  continue;  break;  caseUF_DRAW_CUSTOM_SIZE://豎向即為UF_DRAW_CUSTOM_SIZE  if(fabs(DrawInfo.size.custom_size[0]-297.0)<=dert&&fabs(DrawInfo.size.custom_size[1]-210.0)<=dert)  {    strcpy_s(Profile,"A4_s");//s表示豎向  }  elseif(fabs(DrawInfo.size.custom_size[0]-420.0)<=dert&&fabs(DrawInfo.size.custom_size[1]-297.0)<=dert)  {    strcpy_s(Profile,"A3_s");  }  elseif(fabs(DrawInfo.size.custom_size[0]-594.0)<=dert&&fabs(DrawInfo.size.custom_size[1]-420.0)<=dert)  {    strcpy_s(Profile,"A2_s");  }  elseif(fabs(DrawInfo.size.custom_size[0]-841.0)<=dert&&fabs(DrawInfo.size.custom_size[1]-594.0)<=dert)  {    strcpy_s(Profile,"A1_s");  }  elseif(fabs(DrawInfo.size.custom_size[0]-1189.0)<=dert&&fabs(DrawInfo.size.custom_size[1]-841.0)<=dert)  {    strcpy_s(Profile,"A0_s");  }  break;  }  UF_CALL(UF_PLOT_ask_default_job_name(tagAllSheets.tmp->ent,&JobName));//通过图纸得到默认的任务名  UF_free(JobName);}return1;}  回复可见的内容...
  • 获得曲面点的法向量 和点坐标

    发布者:pooltool 查看次数:1283 评论条数:8 发布时间:2016-12-20
    UF_MODL_ask_face_uv_minmax获得面u,v参数空间(u,v最小,最大值)uf_modl_ask_face_parm  获得曲面的u,v参数;再使用uf_modl_ask_face_props获得曲面点的法向量和点坐标=======================================================tag_tobjs[0]=NULL_TAG;//输入面特征doubleuvs[4];UF_MODL_ask_face_uv_minmax(objs[0],uvs);//获得面u,v参数空间(u,v最小,最大值)doubleparam[2];                          //输入U,V方向值param[0]=(uvs[0]+uvs[1])/2;param[1]=(uvs[2]+uvs[3])/2;doublepoint[3];        //输出点坐标doubleu1[3];          //输出输出一阶导数在U位置doublev1[3];          //输出输出一阶导数在V位置doubleu2[3];          //输出输出二阶导数在U位置doublev2[3];          //输出输出二阶导数在V位置doubleunit_norm[3];    //输出面上该点的矢量方向doubleradii[2];        //输出,双半径,输出主曲率半径UF_MODL_ask_face_props(objs[0],param,point,u1,v1,u2,v2,unit_norm,radii);tag_tpoint_tag=NULL_TAG;      UF_CURVE_create_point(point,&point_tag);//创建点
  • 创建型腔和孔代码

    发布者:pooltool 查看次数:961 评论条数:14 发布时间:2016-12-20
    //创建型腔和孔#include<stdio.h>#include<uf.h>#include<uf_modl.h>#include<uf_ui.h>#include<malloc.h>/*定义全局变量,用于转递相对定位的目标边*/tag_t  edge_blk[12];tag_t  edge_blend[4];/*注册型腔定位的用户函数*/intrpo_routine_pocket(tag_tobj_id){        intirc=0,i;        uf_list_p_t  edge_list;        intcount_list;        tag_t  tem_tag,*edge_pock;        edge_pock=(tag_t*)malloc(12*sizeof(tag_t));                tag_t*obj_id_target,*obj_id_tool;        obj_id_target=(tag_t*)malloc(3*sizeof(tag_t));        obj_id_tool=(tag_t*)malloc(3*sizeof(tag_t));        char*constraint_value[]={"0.0","0.0"};        char*constraint_array[]={"PARA_EDGE_PARMS","PARA_EDGE_PARMS"};        inttarget_qualifier[]={UF_MODL_ENDPOINT_1,UF_MODL_ENDPOINT_1};        inttool_qualifier[]={UF_MODL_ENDPOINT_1,UF_MODL_ENDPOINT_1};                UF_MODL_ask_feat_edges(obj_id,&edge_list);        UF_MODL_ask_list_count(edge_list,&count_list);                for(i=0;i<count_list;i++)        {                UF_MODL_ask_list_item(edge_list,i,&tem_tag);                edge_pock=tem_tag;        }        UF_MODL_delete_list(&edge_list);                obj_id_tool[0]=edge_pock[0];        obj_id_tool[1]=edge_pock[4];                obj_id_target[0]=edge_blk[1];        obj_id_target[1]=edge_blk[0];        irc=UF_MODL_create_rpo_constraints(obj_id,NULL_TAG,NULL_TAG,obj_id_target,                target_qualifier,obj_id_tool,tool_qualifier,constraint_value,constraint_array,2);                free(edge_pock);        free(obj_id_target);        free(obj_id_tool);                if(irc==0)        return(0);    else        return(1);}//孔定位的用户函数intrpo_routine_hole(tag_tobj_id){    intirc,i;    intcount_list;    tag_t  tem_tag;            tag_t  edge_tool[5];    uf_list_p_t  edge_list;    obj_id_target[0]=edge_blend[2];    obj_id_tool[0]=edge_tool[1];    irc=UF_MODL_create_rpo_constraints(obj_id,NULL_TAG,NULL_TAG,obj_id_target,        target_qualifier,obj_id_tool,tool_qualifier,constraint_value,constraint_array,1);    if(irc==0)        return(0);    else        return(1);}/*UG/OPENAPI内部环境的入口函数*/voidufusr(char*param,int*retcode,intparamLen){        if(!UF_initialize())        {                /*定义创建块的参数*/                UF_FEATURE_SIGNsign=UF_NULLSIGN;                doubleblock_orig[3]={0.0,0.0,0.0};                char*block_len[3]={"100","60","40"};                tag_tblk_fea,blk_obj,tem_tag,face_blk[6];                uf_list_p_tface_list,edge_list;                intcount_list;                inti;                                        /*定义创建型腔的参数*/                doublepock_loc[3]={25.0,30.0,40.0};                doublepock_dir[3]={0.0,0.0,-1.0};                doublepock_x_dir[3]={1.0,0.0,0.0};                char*pock_len[3]={"50.0","40.0","20.0"};                char*pock_corner={"0.0"};                char*pock_floor={"0.0"};                char*pock_angle={"0.0"};                tag_tpock_id;                                /*定义创建边倒圆的参数*/                char*blend_radius="20.0";                uf_list_p_tblend_list,blend_edge_list;                tag_tblend_id;                                /*定义创建孔的参数*/                double  hole_origin[3]={60.0,30.0,40.0};                double  hole_cyl_dir[3]={0.0,0.0,-1.0};                char    *hole_dia="25.0";                char    *hole_height="5.0";                char    *hole_angle="0.0";                tag_thole_id;                                /*创建块*/                UF_MODL_create_block1(sign,block_orig,block_len,&blk_fea);                UF_MODL_ask_feat_body(blk_fea,&blk_obj);                                /*获得块上面的标识,用于确定成型特征的孔和型腔安置面,                以及孔的穿透面*/                UF_MODL_ask_body_faces(blk_obj,&face_list);                UF_MODL_ask_list_count(face_list,&count_list);                          for(i=0;i<count_list;i++)                {                        UF_MODL_ask_list_item(face_list,i,&tem_tag);                        face_blk=tem_tag;                }                UF_MODL_delete_list(&face_list);                                /*获得块上边的标识,用于相对定位*/                UF_MODL_ask_body_edges(blk_obj,&edge_list);                UF_MODL_ask_list_count(edge_list,&count_list);                          for(i=0;i<count_list;i++)                {                        UF_MODL_ask_list_item(edge_list,i,&tem_tag);                        edge_blk=tem_tag;                }                UF_MODL_delete_list(&edge_list);                                /*创建型腔,并进行相对定位*/                UF_MODL_register_rpo_routine(rpo_routine_pocket);                UF_MODL_create_rect_pocket(pock_loc,pock_dir,pock_x_dir,pock_len,                        pock_corner,pock_floor,pock_angle,face_blk[0],&pock_id);                UF_MODL_unregister_rpo_routine();                                /*进行边倒圆*/                UF_MODL_create_list(&blend_list);                UF_MODL_put_list_item(blend_list,edge_blk[6]);                UF_MODL_create_blend(blend_radius,blend_list,0,0,0,0.5,&blend_id);                                /*获取倒圆的边,用于孔的相对定位*/                UF_MODL_ask_feat_edges(blend_id,&blend_edge_list);                UF_MODL_ask_list_count(blend_edge_list,&count_list);                          for(i=0;i<count_list;i++)                {                        UF_MODL_ask_list_item(blend_edge_list,i,&tem_tag);                        edge_blend=tem_tag;                }                UF_MODL_delete_list(&blend_edge_list);                                /*创建孔,并进行相对定位*/                UF_MODL_register_rpo_routine(rpo_routine_hole);                        UF_MODL_create_simple_hole(hole_origin,hole_cyl_dir,hole_dia,                        hole_height,hole_angle,face_blk[0],face_blk[1],&hole_id);                                UF_MODL_unregister_rpo_routine();                                UF_terminate();        }}
NX二次开发热门资料
点击查看VIP会员特权
技术帖子评论排行
最新评论技术帖子