|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
, M6 n. W" o+ B! |9 k. }9 B+ |! VTeamcenter ITK二次开发源码分享: Item 创建 createpost操作1 m) l$ @1 x, ?) t
- #include <stdarg.h>+ A/ r( \ @ i) G# p5 T( j
- #include <stdio.h>. `1 Y! ~4 a# P/ ]- }9 j
- #include <stdlib.h>! p- G" @9 o1 U1 N& g
- #include <string.h>
8 d: V' j5 }# R! y1 K/ m# f - #include <UG_va_copy.h>9 K0 ?& g9 y) w) r. ?3 ?/ c
- #include <TC/emh.h>
1 ?# x! @/ q5 u9 }6 `) L- Q - #include <ict/ict_userservice.h>0 L; s" k$ j6 \, j; B q
- #include <itk/bmf.h>
/ D( E+ f' \* _7 [ - #include <tc/emh.h>
& U- ^7 c& S& c+ B& C+ t - #include <tc/tc.h>! {- v9 X0 S" Q( S3 t6 I* }8 F" u
- #include <tccore/item.h>
! k4 D, L h" [) G - #include <tccore/method.h>
2 S! q, x4 J) }! n' t5 M# t - #include <metaframework/CreateInput.hxx>
5 F; |& c8 M. U; O" H. h+ t
) a+ N% S- V2 J( I- t m4 N2 \- extern "C" DLLAPI int A2_gtac_extension_rule(METHOD_message_t *m, va_list args)2 t5 b, Q, Q8 M) i# a/ B
- {
7 e3 |& a. V4 [, J' |( C, P - printf("\n\n A2_gtac_extension_rule \n\n");
' `" |! U. @0 n8 U1 n - ; _8 L. H F4 F" e' T8 ?3 L& E
- int ifail = ITK_ok;
/ }* w3 U7 w& }5 q" b1 O
5 F4 n/ I5 Q+ e- y- va_list largs;
& E. U6 r: y& y& t. ? - va_copy( largs, args );/ Z# T8 _5 @9 z/ t8 ^
- Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);
, @; e- A* H+ C `( b/ ? - va_end( largs );/ q% S+ A' F& ~2 m9 u* A D s! Q
- 8 V% p& j- r, ~9 k q; p
- tag_t new_item = m->object_tag; : L( i6 v( c$ V; W" E: b* `' X
- char *uid = NULL;6 z$ q) Y, f7 |4 O
- ITK__convert_tag_to_uid(new_item, &uid);. K) W+ _$ e6 w: G; U1 p4 _
- printf(" new_item: %s \n", uid);
, C6 `; s& t5 S4 {- V: e - MEM_free(uid);$ w8 d2 x+ [& y- c) c
- " `2 w5 q0 O1 F1 u+ F
l: O# I" y! y2 s& C+ [. R- bool isNull = true;- p/ |7 ~- ]! U- U3 ^
- tag_t new_rev = NULLTAG;- @; N9 }+ r/ |5 e% W% ~# H: }
- ifail = creInput->getTag("revision", new_rev, isNull);7 C4 q! \ G* C/ x/ r
- if((isNull == FALSE)&& (ifail == ITK_ok)); d6 {" |5 _) V$ w5 N: y& Z
- {( m, v1 H, \2 l0 n
- printf(" new_rev: %u \n", new_rev);5 W/ [# a0 @7 s! l; d9 U, I
- }
9 x3 [8 O8 H' a& n; X - 6 g6 V# M# B7 w6 b+ o. r/ ~- B9 |
- tag_t master_form = NULLTAG;$ Q& z5 c; i# E- {; S: Q$ b
- ifail = creInput->getTag("IMAN_master_form", master_form, isNull);/ [- p5 A6 G7 A
- if((isNull == FALSE)&& (ifail == ITK_ok))4 }$ }7 Y1 D7 v7 t/ Z G# ?4 Z
- {7 y2 t% ~9 q ?( M
- printf(" master_form: %u \n", master_form);9 |' H) Q( N: ?0 \) v( N
- }
) |+ M2 G: ?3 I3 f9 B
1 f" ]' |9 R8 X6 ~- std::string item_id = "";
( C( G7 M. C% }2 C% y4 [) [9 G# a - ifail = creInput->getString("item_id", item_id, isNull);
; R% `3 N- j( e& p. R, F i' c - if((isNull == FALSE)&& (ifail == ITK_ok))
: ]- W" u: i1 ^, J. n/ D$ m/ W+ X - {6 Y- M" ] T+ _2 H6 c; t
- printf(" item_id: %s \n", item_id.c_str());( J7 r+ Z+ ^* `4 }4 L
- }
' }' }8 [# T9 H% C - . c' R9 _% O# T0 m2 @8 J
- std::string name = "";3 R4 U5 l% |( ^( w! _* i
- ifail = creInput->getString("object_name", name, isNull);& Y: m- n; X {7 L: N
- if((isNull == FALSE)&& (ifail == ITK_ok))
. d+ X4 c. m; R2 \6 c4 ` - {# Z+ X8 O1 g! e4 u& X. K6 C* e
- printf(" object_name: %s \n", name.c_str());# `; E4 P& Z% a4 R n
- }
: D9 Q$ i- t1 q5 r$ D4 m
, C9 r4 m3 w" O- return ifail;;
7 j; j3 l" e: Y" x6 ^8 c - }
% x6 r5 r, Z7 n* y! V
复制代码 - Y) [# R3 n B z5 r+ f7 r0 r& N) K
$ K- h# D' P. {% y* J
p9 }' Y8 P, s+ s- i |
|