今天这个例子比较简单,讲一个ugCAM二次开发中创建操作的函数写法。 原帖地址:http://www.ugufun.com/?p=89 void do_open_api()
# H6 ^2 W* M7 J' k: l& J x{& ]$ M/ E/ S* k0 R
// char *type_name="mill planar";( Y4 L* f( C, A6 s
// char *subtype_name="FACE_MILLING_AREA";
8 X- i `% c2 x. mchar *type_name="balda_cu_dia6";8 b1 C: _0 ~1 d6 q! F
char *subtype_name="CEM6R0_PLANE_FACE";
# |- y# a3 U+ h+ v" `char opername[133+1];: M: x1 v( j8 c- `; L. s
tag_t oper_tag;3 j$ n% z' T' p+ A+ w% Z# U
tag_t group=NULL;
# v6 v+ t$ V; O/ q: Uchar *filename="d:list.txt";
) H9 u* X- e6 S" R+ sint ir3=1; //生成一个加工操作1 C# G6 w S* k# h5 g! k. T- x _
UF_OPER_create(type_name,subtype_name,&oper_tag);/ O' M9 e: p4 z( ~+ X$ [8 ]
//获得操作的组名/ G1 P& B% i) Z& |, a3 Z( A
UF_OPER_ask_name_from_tag(oper_tag,opername);
4 S6 _: L9 H( P& X9 i3 y* e//UF_OPER_ask_program_group ();
: ^3 a5 l* t i4 x4 k+ n3 {4 {// uc1601(opername,1);
7 k8 T6 X% p' V- T& lUF_UI_open_listing_window();
3 c3 w( P+ C& j1 j0 g0 H8 tUF_UI_write_listing_window(opername);
: H$ h3 F. W( E6 @: a1 _UF_UI_write_listing_window("\n");- e" D" m0 w& N2 i# C
uc4400(8,filename,ir3);
4 c1 ~& D4 F$ V: B9 q9 b# ]UF_UI_write_listing_window(filename);
) m- l$ k- |' ^6 C% s9 c& z3 }//设置加工参数
2 D1 Z& @# `, r& U1 c//UF_OPER_set_machining_data (oper_tag);$ z( R1 W( V, a. |& [' `
} / F% y# I: J J/ o
|