1 NX11+VS2013
2
3 #include <uf.h>
4 #include <uf_part.h>
5 #include <uf_draw.h>
6 #include <uf_ui.h>
7
8 UF_initialize();
9
10 //查询图纸页tag
11 int Num_Drawings;
12 tag_p_t Drawing_Tags = NULL_TAG;
13 UF_DRAW_ask_drawings(&Num_Drawings, &Drawing_Tags);
14
15 if (Num_Drawings == 0)
16 {
17 uc1601("提示:当前没有图纸页", 1);
18 }
19
20 else
21 {
22 //打开图纸
23 UF_DRAW_open_drawing(Drawing_Tags[0]);
24
25 //导入图框
26 UF_import_part_modes_t Modes;
27 Modes.layer_mode = 0;
28 Modes.group_mode = 0;
29 Modes.view_mode = 0;
30 Modes.cam_mode = false;
31 double Dest_Csys[6] = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0 };
32 double Dest_Point[3] = { 0.0, 0.0, 0.0 };
33 tag_t Group = NULL_TAG;
34 UF_PART_import("C:\\model1.prt", &Modes, Dest_Csys, Dest_Point, 1.0, &Group);
35 }
36
37 UF_terminate();
来源:oschina
链接:https://my.oschina.net/u/4268222/blog/3516278