PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2014-1-15 19:33:29

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

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

x

3 I% A0 E7 q5 |Teamcenter ITK二次开发源码分享: Item 创建 createpost操作
$ H  c6 Z0 I/ B; p
  1. #include <stdarg.h>6 _# x1 s5 K' g5 i7 r3 J+ T1 {
  2. #include <stdio.h>1 Z& j3 Q! E% J) l8 e) d, k
  3. #include <stdlib.h>
    4 c$ E5 z4 o: p7 @
  4. #include <string.h>+ j* e, z  E. c6 B
  5. #include <UG_va_copy.h>. \3 m2 Q' _& Y, Z' X! p3 t. x
  6. #include <TC/emh.h>
    8 J9 J% A: D2 p4 ^7 I
  7. #include <ict/ict_userservice.h>9 B7 |; g& s$ ^! o. n
  8. #include <itk/bmf.h>
    / W8 _/ e; @0 y/ E# e
  9. #include <tc/emh.h>
    ! o; J$ l) ~# g) B! y; w
  10. #include <tc/tc.h>
    $ n9 G) \* P7 _: K
  11. #include <tccore/item.h>
    3 f! V( ?2 I1 B5 d( P$ v
  12. #include <tccore/method.h>
    4 O+ {0 D4 A2 M4 x; q$ u
  13. #include <metaframework/CreateInput.hxx>
    2 C9 z- r; x; d

  14. - Z1 j! Y$ i. D& @  Z8 [
  15. extern "C" DLLAPI int  A2_gtac_extension_rule(METHOD_message_t *m, va_list args)) K7 Q' ^- x" ]! `0 s' S
  16. {% I- Y2 z& ?9 l2 X
  17.     printf("\n\n A2_gtac_extension_rule \n\n");6 }& {  y5 @/ r# k9 W

  18. ! j  E6 K: [1 M/ y( r2 \1 V' R
  19.     int ifail = ITK_ok;
    * ^- q5 X3 z, U

  20. : b" P3 R' _" f2 ]& Y' c
  21.     va_list largs;
    8 C3 G: e- P( N
  22.     va_copy( largs, args );
    * [1 R4 k% N! ]
  23.     Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);2 o$ a9 |) o5 w2 v2 `4 T0 H
  24.     va_end( largs );
    . y# |! A8 y. S. o, Y/ d4 r" x

  25. / g. [# w, U$ n8 I  q* a
  26.     tag_t new_item = m->object_tag;    4 A4 W3 ~' C: U4 W
  27.     char *uid = NULL;: o" O1 X+ X/ A; `. S
  28.     ITK__convert_tag_to_uid(new_item, &uid);
    0 l# [# |3 j  [0 W. n  I
  29.     printf("    new_item: %s \n", uid);% I! M9 \# b7 V8 N
  30.     MEM_free(uid);
    * C0 @+ ], a- n
  31. " W8 Y% b" t: B5 Q* {, h0 a" q6 s
  32. 9 F2 Z+ `! O2 y0 g. I
  33.     bool isNull = true;
    2 V2 r; y( C# Z. |
  34.     tag_t new_rev = NULLTAG;
    5 j) Z/ \. ^% r: X3 d! H! v2 s
  35.     ifail = creInput->getTag("revision", new_rev, isNull);
    $ L  E$ ^$ i2 V7 K& l
  36.     if((isNull == FALSE)&& (ifail == ITK_ok))
    ( @3 |/ Q6 U& A0 f% q! E, h
  37.     {
    $ R. [# ^  G) ^" V
  38.         printf("    new_rev: %u \n", new_rev);
    + A1 {9 A$ `1 s
  39.     }7 A4 u, b7 {1 Z8 a
  40.    
    " a& \5 |/ \$ B: y2 w
  41.     tag_t master_form = NULLTAG;+ \/ u2 e$ n0 `2 e0 Q; y9 ^' K
  42.     ifail = creInput->getTag("IMAN_master_form", master_form, isNull);" W  v6 z+ b- ^& [
  43.     if((isNull == FALSE)&& (ifail == ITK_ok))  A6 n  ?- P9 j  m5 c8 P/ e6 Y
  44.     {  J. q  \/ M( G
  45.         printf("    master_form: %u \n", master_form);$ r  M& a$ P7 j0 y1 w$ t/ r) i
  46.     }! Z! J9 t% a) |5 j6 F& l1 s
  47. 9 X/ M; e5 ]5 l$ M, R
  48.     std::string item_id = "";
    9 B$ d# o, s9 s. t  L
  49.     ifail = creInput->getString("item_id", item_id, isNull);6 `) W" h  \7 W! T8 l/ N; |7 E
  50.     if((isNull == FALSE)&& (ifail == ITK_ok))) t: y. m& s0 J$ K2 ^3 P0 y
  51.     {/ k; r/ `& A8 H" ?. M4 o
  52.         printf("    item_id: %s \n", item_id.c_str());* t8 x1 x" C1 w9 C2 @9 o; e
  53.     }( `8 m3 X8 l% t( i. K* D; T
  54. / ~/ \& T8 A# U4 y- V9 R% }- ?1 x
  55.     std::string name = "";
    8 _# a; C& ^2 M$ _
  56.     ifail = creInput->getString("object_name", name, isNull);( _( H+ ~4 d& @' _7 y+ b( W, ]
  57.     if((isNull == FALSE)&& (ifail == ITK_ok))
    5 ?4 D( B! F% f% @
  58.     {
    * S1 h. r" Z, Q
  59.         printf("    object_name: %s \n", name.c_str());
    + ?' ^$ |# x- f8 S* Y
  60.     }' @) x* J$ ?7 o9 `3 O

  61. * S/ D3 l, C$ J8 ]" u# o6 f- |
  62.     return ifail;;
    # L) t+ Y: E- o/ }! u1 ]" y
  63. }5 d6 V4 j* d9 A9 s
复制代码

+ T* z  Y1 H( {  `/ G$ L7 d. `, f; L+ {- L6 H$ j+ _

; N! l- Z+ F, _- j2 f- a$ s
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了