点击查看详细介绍

API创建孔、阵列以及body(体)feature(特征)face(面)edge(边)之间的访问源码

nxopen 11年前 7656 35

购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008  QQ号:85585969  


直接看代码:

static void do_UGopenApi(void)

{

//创建一个体

double coner[3]={0,0,0};

char *edge[3] = {"100","60","40"};

tag_t blk_tag;

UF_MODL_create_block1(UF_NULLSIGN,coner,edge,&blk_tag);

//create a blend start

char *radius = "20";

uf_list_p_t blend_list,face_list,edge_list;

tag_t body_tag,tem_face,tem_edge,faces[6],edges[12],blend_feature;

int face_count,edge_count;

// 遍历面

UF_MODL_create_list(&face_list);

UF_MODL_ask_feat_body(blk_tag,&body_tag);

UF_MODL_ask_body_faces(body_tag,&face_list);

UF_MODL_ask_list_count(face_list,&face_count);

for(int i =0 ;i <face_count;i++)

{

UF_MODL_ask_list_item(face_list,i,&tem_face);

faces[i]=tem_face;

}

UF_MODL_delete_list(&face_list);

//遍历边

UF_MODL_create_list(&edge_list);

UF_MODL_ask_body_edges(body_tag,&edge_list);

UF_MODL_ask_list_count(edge_list,&edge_count);

for(int j = 0 ; j < edge_count;j++)

{

UF_MODL_ask_list_item(edge_list,j,&tem_edge);

edges[j]=tem_edge;

}

UF_MODL_delete_list(&edge_list);

// 创建阵列

●●●请先 登陆注册 后查看●●●

// 创建孔

double location[3]={80,40,40};

double direction[3]={0,0,-1};

const char * diame="15";

const char * depth="5";

const char * angle="0";

tag_t hole_id;

UF_MODL_create_simple_hole(location,direction,diame,depth,angle,faces[0],faces[1],&hole_id);

// create instance

double origin[3]={10,10,0};

double dir[3]={0,0,1};

tag_t cyl_tag;

UF_MODL_create_cyl1(UF_NEGATIVE,origin,"20","10",dir,&cyl_tag);

char * number_in_x="2";

char * distance_x ="30";

char * number_in_y="2";

char * distance_y ="30";

tag_t feature_obj_id;

uf_list_p_t feature_list;

UF_MODL_create_list(&feature_list);

UF_MODL_put_list_item(feature_list,cyl_tag);

UF_MODL_create_linear_iset(0,number_in_x,distance_x,number_in_y,distance_y,feature_list,&feature_obj_id);

UF_MODL_delete_list(&feature_list);

}

//代码结束

1

最新回复 (35)
  • zcdong86 11年前
    1

    好资料就得学习学习!

  • 425131361 11年前
    2

    好资料就得学习学习!

  • a0806 11年前
    3

    有了这样的资料,可以省去很多麻烦

  • juanqinqin 11年前
    4

    赞一个,学习了!!!

  • 425131361 11年前
    5

    赞一个,学习了!!!

  • qinchuang1 11年前
    6

    赞一个,学习了!!!

  • 豆沙包2010 11年前
    7

    谢谢分享

  • 豆沙包2010 11年前
    8

    学习下,谢谢分享

  • lzc123321 11年前
    9

    好次料,学习很好!!!!!!!!

  • rancent 11年前
    10

    谢谢分享 学习了~~~~~~~~~

  • 591xx 11年前
    11

    好资料就得学习学习!

  • xvxin1990 11年前
    12

    谢谢分享,可惜我还是看不懂

  • a7834180 11年前
    13

    哈哈....谢谢分享资料!

  • renforUG 11年前
    14

    学习了,赞一个了。。。

  • Hevvnet 11年前
    15

    謝謝大大用心的整理

请登录后发表新帖