青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 2492|回复: 2

[疑难] 求指教CAM二次开发问题之关于创建刀具组

[复制链接]
发表于 2012-9-4 22:05 | 显示全部楼层 |阅读模式
本意是想先建立一个程序组,然后在建立个刀具组,并将新建的程序组放在刀具组下。代码如下,但是可以建立一个程序组,但是刀具组建立不了。求解决!!!!
2 f# }+ @2 N2 A% r, E1 S  logical answer;3 q  H! T! u  a
  char reason[1024+1];$ q  V# l" o, q4 [/ N+ K- ^: m2 C
  tag_t group_tag;
6 S: e% W+ y, t6 H  i/ {" u1 s  tag_t program_root_tag,setup_tag1;
6 k7 I  y4 K( ^9 f  y, ]3 X  tag_t program_null_tag=NULL_TAG;
) A4 z% t1 ^: E) }3 R8 M! d; Q  tag_t mct_root_tag,new_cutter,mct_null_tag;$ x) {  @( x- J

5 }6 N' L1 C* e4 Z9 E, ^7 i // 创建程序组
( I+ ?4 }) ^8 b0 d$ t( A  J  UF_CALL(UF_SETUP_ask_setup(&setup_tag1));
$ L. r6 @* `" _% Z0 `( `  UF_CALL(UF_SETUP_ask_program_root(setup_tag1,&program_root_tag));
( d/ _  V. j- K; C/ ]  UF_CALL(UF_SETUP_ask_program_null(setup_tag1,&program_null_tag));4 ?' [4 k3 r3 y9 P
  UF_CALL(UF_NCPROG_create("mill_planar","PROGRAM",&group_tag));
- L' }& _/ _; `4 ]     UF_CALL(UF_OBJ_set_name(group_tag,"xi_jizhunmianban"));
% R! e2 e! V9 [. v) R  b' x  UF_CALL(UF_NCGROUP_can_accept_member(program_root_tag,group_tag,&answer,reason));5 h* T/ k4 D& Q; A0 Z3 n
  if (answer)4 q( {+ P0 H. ]/ \2 X
  {
- X8 E' z" K$ Y8 l1 H! c   UF_CALL(UF_NCGROUP_accept_member(program_root_tag,group_tag));
, }; {8 G# r) K! D  }
8 M1 E8 T- m6 }4 k) }  else
/ e" C0 r& q8 N1 _) N  {& i2 W5 X8 v# Q' T
   UF_CALL(UF_NCGROUP_accept_member(program_null_tag,group_tag));
6 n% N8 R; ~  t; }; V9 B( l  }, q0 Z8 ?( r  ?( ~
* d, I1 C& N. b( ]( w4 f
//创建刀具组$ M. v( o6 L+ {; c6 J% H% I5 w: _
  UF_CALL(UF_SETUP_ask_mct_root(setup_tag1,&mct_root_tag));
  w0 t& P9 l+ c% Z+ Q4 o* `  UF_CALL(UF_SETUP_ask_mct_null(setup_tag1,&mct_null_tag));9 d( d- H6 p6 ^/ H* k
  UF_CALL(UF_CUTTER_create("mill_planer","MILL",&new_cutter));" C6 m& z* U" U
  //UF_CALL(UF_OBJ_set_name(new_cutter,"JZBM"));& N5 g* I! x( S, ^1 \
  UF_CALL(UF_NCGROUP_can_accept_member(mct_root_tag,new_cutter,&answer,reason));# F% F. }0 S9 ?: G9 U* o% {
  if (answer)7 D6 X% @% O% |4 J4 \  V
  {5 S2 ]: H8 e; [) [2 x
   UF_CALL(UF_NCGROUP_accept_member(mct_root_tag,new_cutter));
, V8 o3 F0 V+ e2 J. p  }
' h. w' _5 Z. O/ L9 t  else
$ ]6 ]$ j$ B# A  {
7 \) y6 ~( R% d& j  g) L   UF_CALL(UF_NCGROUP_accept_member(mct_null_tag,new_cutter));. g5 _" |( i) G) {5 X1 f3 U$ T, N
  }. }9 E) Q7 z5 t( I. c; k& q
//将程序组放在刀具组上
* |# P; q8 G. P: z. h  UF_CALL(UF_NCGROUP_can_accept_member(new_cutter,new_oper,&answer,reason));
  h; j6 e, K1 d. F& A- X! q  if (answer)& A5 `( R+ J' w: u7 t* [! J
  {- x5 @" L7 Z5 ?+ E
   UF_CALL(UF_NCGROUP_accept_member(new_cutter,new_oper));9 [  o; U/ f, S# o
  }4 V/ w, r5 |$ |" r
  else  {" _) o$ q1 u& ^
  {$ E0 v& G1 y% `- @
   UF_CALL(UF_NCGROUP_accept_member(mct_null_tag,new_oper));
! E" D; A  c, X; ^' a5 _  }
: P" B  W& `- w
发表于 2013-7-11 07:02 | 显示全部楼层
很简单的道理.你操作UG CAM时,能在刀具操作导航器界面新建程序组吗?答案肯定不行.
回复 支持 1 反对 0

使用道具 举报

发表于 2017-5-28 16:48 | 显示全部楼层
二次开发是nx操作的简化,在nx中手工不能操作完成的,二次开发中不可能实现的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-3-7 00:38 , Processed in 0.048484 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表