|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
& x: Q8 Y% w4 I, \6 c! ^Teamcenter ITK二次开发源码分享: Item 创建 createpost操作
0 v/ C# c5 w0 H7 u: c1 A( o- #include <stdarg.h>* |. @1 f" v7 N3 [8 a2 L
- #include <stdio.h>2 J( Z8 p# I) j+ V, s( K6 ]
- #include <stdlib.h>
' v; b6 y. M6 N& u S3 L; T: C- Q - #include <string.h>
5 t0 B3 ^3 o5 _/ s - #include <UG_va_copy.h>
; Q! R0 I( _ G+ l3 \ - #include <TC/emh.h>
5 u2 b A0 Q: t4 J0 K$ @, z - #include <ict/ict_userservice.h>" A; o2 c& W4 d* D
- #include <itk/bmf.h>
. k$ r7 K8 ]. N( U0 i - #include <tc/emh.h>; `6 X! S5 f1 L5 z0 ~+ C: w5 v! S! m
- #include <tc/tc.h># C# g7 z- x" w* h# q5 r. [8 t
- #include <tccore/item.h>
# N2 _7 `1 I/ z% ?* E* ^* _) s* { - #include <tccore/method.h># a# W$ }7 G* x
- #include <metaframework/CreateInput.hxx>
& q+ { p# ?6 R7 l3 L# X9 G8 T - 9 B9 z% [# _' W+ @/ y% f% B. A
- extern "C" DLLAPI int A2_gtac_extension_rule(METHOD_message_t *m, va_list args)
* I' q3 p0 A }; d( c$ g: f; Y - {
5 H8 ^+ `" ~' y7 b- X$ ^ - printf("\n\n A2_gtac_extension_rule \n\n");
0 M8 [* T" C$ A6 d - # X8 o8 q) k- X8 [) I, r( l" W
- int ifail = ITK_ok;9 C2 j3 i& d, Q0 ` T, {! K
- ( k5 }* K- A' _) J9 p; [, ^! \
- va_list largs;' B/ e0 d, C" J! g1 J
- va_copy( largs, args );( ~ m0 i2 `( y$ }: N f
- Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);
- P$ J$ K( B! R4 I - va_end( largs );
0 s2 Y/ F- u2 f4 C6 S/ m) f
7 x( M/ W! k3 m% J- tag_t new_item = m->object_tag; 6 V' a3 F$ k5 g
- char *uid = NULL;
8 G+ X: s$ h$ U; e, t - ITK__convert_tag_to_uid(new_item, &uid);8 ^0 o+ x/ G4 u7 f7 f
- printf(" new_item: %s \n", uid);* a5 O4 ~5 K9 W/ p, o8 T
- MEM_free(uid);; s y/ R q" ~( |, q0 @
- ( `( z* k) g9 d
4 P" y ?* Y* B$ @+ T- J- bool isNull = true;
4 z4 K: s6 N, |6 s v% M4 @ - tag_t new_rev = NULLTAG;' h) J& _; T$ `8 X' \/ Y9 J" D6 O
- ifail = creInput->getTag("revision", new_rev, isNull);
5 p% w2 `+ N0 B% w/ C0 F - if((isNull == FALSE)&& (ifail == ITK_ok))
( E9 F4 s; [0 L# g - {' f6 k4 P5 U. j4 p) I! T
- printf(" new_rev: %u \n", new_rev);" \! }2 z- O5 ~# J
- }7 }# }* ?, Y" X0 g4 z* i4 d5 n# ^
-
) r9 A! I) f, Z# D8 s% e1 U0 } - tag_t master_form = NULLTAG;
& \. @/ r9 T4 b3 I: @3 Y - ifail = creInput->getTag("IMAN_master_form", master_form, isNull);
" M& ?/ P3 \$ u) r2 ]% F- E/ G - if((isNull == FALSE)&& (ifail == ITK_ok))
6 r7 Q0 f8 A3 ~, s" n9 x& v - {
; w3 U& Q( m$ C) H( h* `# @ - printf(" master_form: %u \n", master_form);
5 X6 t* S6 [% y4 c8 p" J' ` - }( h3 U4 h; i3 A. C
- ' }7 ^; A; Y* R% }( ~! J N
- std::string item_id = "";8 S0 S1 y+ V' E% K1 I
- ifail = creInput->getString("item_id", item_id, isNull);
) T% ], t7 y) ~7 i/ G/ I) C8 R - if((isNull == FALSE)&& (ifail == ITK_ok))
0 l# L0 u! \* Q3 D* [ - {" ?( [8 P# D7 X& a
- printf(" item_id: %s \n", item_id.c_str());
6 C2 o9 D. U/ L. [' X7 g& g - }
. j2 i4 I/ |5 P- n - / P, F% a0 C4 s% f4 F6 O9 u
- std::string name = "";" K9 X5 Q3 K6 A' F a1 U3 ]
- ifail = creInput->getString("object_name", name, isNull);. A- T' l9 J; U2 o' ]7 e8 G
- if((isNull == FALSE)&& (ifail == ITK_ok))6 Q Y/ E2 ~8 d& G1 i' V% S
- {) u( t# g# B, O$ _4 l. v
- printf(" object_name: %s \n", name.c_str());2 e- |0 C+ f1 L3 N
- }
" S! ~! i5 \7 m! ^/ x7 Y- G/ y2 k - : D) u1 T8 h2 I' k2 \+ X7 O
- return ifail;;* `" x B) I* W3 L/ s: D
- }1 e1 Y- }2 N' h
复制代码 6 |; o& w( n* S3 S( I- s0 o' z$ a
7 s5 e. x& y0 l3 f# |
3 H3 d @2 y+ L6 S6 J# p: c |
|