PLM之家精品课程培训,联系电话:18301858168 QQ: 939801026

  • NX二次开培训

    NX二次开培训

    适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术对于老鸟也值得借鉴!.

    NX CAM二次开发培训报名 NX二次开发基础培训报名
  • PLM之家Catia CAA二次开发培训

    Catia二次开发培训

    Catia二次开发的市场大,这方面开发人才少,难度大。所以只要你掌握了开发,那么潜力巨大,随着时间的积累,你必将有所用武之地!

  • PLM之Teamcenter最佳学习方案

    Teamcenter培训

    用户应用基础培训,管理员基础培训,管理员高级培训,二次开发培训应有尽有,只要你感兴趣肯学习,专业多年经验大师级打造!

  • PLM之Tecnomatix制造领域培训

    Tecnomatix培训

    想了解制造领域数字化吗?想了解工厂,生产线设计吗?数字化双胞胎,工业4.0吗?我们的课程虚位以待!

PLM之家PLMHome-国产软件践行者

teamcenter ITK二次开发源码分享: Item 创建 createpost操作

[复制链接]

2014-1-15 19:33:29 5555 0

admin 发表于 2014-1-15 19:33:29 |阅读模式

admin 楼主

2014-1-15 19:33:29

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x

& Z3 n/ |8 t0 C1 \Teamcenter ITK二次开发源码分享: Item 创建 createpost操作7 I5 x( k0 z4 c2 a
  1. #include <stdarg.h>' E) q: x) z2 Y( x
  2. #include <stdio.h>
    2 c! u- P* e3 X; o. F
  3. #include <stdlib.h>
    / E- J$ S0 }( X3 I% |
  4. #include <string.h>
      ^# V5 L9 @5 c8 Y/ O8 r
  5. #include <UG_va_copy.h>6 Y/ K* ]4 ?: O$ b' r5 r/ i
  6. #include <TC/emh.h>
    6 `' {6 ^0 f7 s: z5 v7 b' R" W
  7. #include <ict/ict_userservice.h>+ I7 H" Q7 w0 J, l6 `! N( ]
  8. #include <itk/bmf.h>8 u* P4 J6 o0 u; h
  9. #include <tc/emh.h>& p, G/ \/ P. j
  10. #include <tc/tc.h>
    9 p3 G* u* f6 N! L8 Z2 _
  11. #include <tccore/item.h>
    ) R1 v: F) \0 Q( X/ k
  12. #include <tccore/method.h>
    5 c/ n( b% g- j4 I+ R- f/ G$ w0 e
  13. #include <metaframework/CreateInput.hxx>
    * _" w. y) ^% F/ q- H

  14. % @9 H9 K% [" o1 `. v( G3 M
  15. extern "C" DLLAPI int  A2_gtac_extension_rule(METHOD_message_t *m, va_list args): }' S) {  @& w4 Q- l
  16. {! o0 q% G) B" W: u
  17.     printf("\n\n A2_gtac_extension_rule \n\n");" |) C1 I3 c+ A' u

  18. 7 I/ |. _7 Z; Q( L
  19.     int ifail = ITK_ok;
    1 v/ t2 e  F& F6 H8 _/ \3 p

  20. + M3 U: G7 ^) L! `: c
  21.     va_list largs;
    + @) Y2 ]0 o8 h' `) h
  22.     va_copy( largs, args );; P2 o3 G1 o. o
  23.     Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);
    8 B& {! z* z6 Q0 |7 X
  24.     va_end( largs );) l7 U" D# M6 J/ G$ C

  25. ) X( `& j& R; x* }$ m, z# G" \
  26.     tag_t new_item = m->object_tag;   
    0 B1 C; a; ]  v. z5 F
  27.     char *uid = NULL;
    / ^) n9 g& [  n+ L
  28.     ITK__convert_tag_to_uid(new_item, &uid);" {9 l. ?' g5 ?  y1 D4 T
  29.     printf("    new_item: %s \n", uid);6 k, f. T6 @$ F. T  S. e
  30.     MEM_free(uid);
    2 m* {& q/ C# m1 a
  31. ; b1 B1 Q: x! r+ V) |. n
  32. 4 i% ], Q! ~+ P* X
  33.     bool isNull = true;0 b! Z: a. S3 ]( g0 [+ i/ [
  34.     tag_t new_rev = NULLTAG;
      y  Z, ?7 A' @4 l# q
  35.     ifail = creInput->getTag("revision", new_rev, isNull);
    1 a( g. x9 W7 }$ D/ F& ~
  36.     if((isNull == FALSE)&& (ifail == ITK_ok))
      q5 w, _- P8 x& }# Y
  37.     {
    - M# @4 {/ [$ K4 N$ j7 u) v- ]
  38.         printf("    new_rev: %u \n", new_rev);
    7 @" G$ E) S8 [- R' f( [+ [( F# ?8 n, S
  39.     }
    + d+ z/ ]- V% f( s" y" u( j( f
  40.    
    6 M0 R- S3 ?) b: Q1 a$ N1 Q
  41.     tag_t master_form = NULLTAG;
    % f3 g% [% P1 K7 ?- s
  42.     ifail = creInput->getTag("IMAN_master_form", master_form, isNull);; D  a6 B/ D3 f& M1 Z9 ^4 q1 w
  43.     if((isNull == FALSE)&& (ifail == ITK_ok))) J* H% j) ~+ a5 Y# A' B
  44.     {1 t+ `9 d# a( V! N8 n
  45.         printf("    master_form: %u \n", master_form);! B. s5 p3 G" N, L
  46.     }
    8 d3 P1 f: Y6 d
  47. ) C9 t+ {6 a$ {
  48.     std::string item_id = "";7 H# s+ A  m' g! N- z; w/ M6 S8 u1 P! B
  49.     ifail = creInput->getString("item_id", item_id, isNull);6 I8 p7 p9 e* }6 J! l
  50.     if((isNull == FALSE)&& (ifail == ITK_ok))
    ) ?0 k: I* W6 |7 u! i
  51.     {9 Z3 y* T& w) u$ Q+ a5 O7 l* k
  52.         printf("    item_id: %s \n", item_id.c_str());7 _/ o. c4 l% a  O, C& L! D
  53.     }, \) |3 {1 K* P: s+ x" }; q. t

  54. 1 z- R0 d2 K) X% G* z/ P5 w8 D# I
  55.     std::string name = "";
    1 D7 n4 c4 i+ M. r+ @& `- X; u
  56.     ifail = creInput->getString("object_name", name, isNull);( }  R3 j# u2 g5 B, ]/ x9 K- i8 ], E
  57.     if((isNull == FALSE)&& (ifail == ITK_ok))
    , W0 j' v0 d! _% D# W7 D$ B
  58.     {: V& {7 D. v+ O$ w) j
  59.         printf("    object_name: %s \n", name.c_str());
    7 ~( Q: @4 r5 [6 s1 T
  60.     }
    & A2 T' ^: `. A* P' y
  61. $ W0 N9 k  K  D& H. V3 f/ c7 n. c
  62.     return ifail;;
    : X/ G. y0 }  a
  63. }
    3 q0 Y1 x* n) x- n# ?
复制代码

& D3 |/ ~/ E( ~6 p
- l, t4 |; }% i9 S
: M; H+ c6 n' C2 S2 t5 L
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了