|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
3 I% A0 E7 q5 |Teamcenter ITK二次开发源码分享: Item 创建 createpost操作
$ H c6 Z0 I/ B; p- #include <stdarg.h>6 _# x1 s5 K' g5 i7 r3 J+ T1 {
- #include <stdio.h>1 Z& j3 Q! E% J) l8 e) d, k
- #include <stdlib.h>
4 c$ E5 z4 o: p7 @ - #include <string.h>+ j* e, z E. c6 B
- #include <UG_va_copy.h>. \3 m2 Q' _& Y, Z' X! p3 t. x
- #include <TC/emh.h>
8 J9 J% A: D2 p4 ^7 I - #include <ict/ict_userservice.h>9 B7 |; g& s$ ^! o. n
- #include <itk/bmf.h>
/ W8 _/ e; @0 y/ E# e - #include <tc/emh.h>
! o; J$ l) ~# g) B! y; w - #include <tc/tc.h>
$ n9 G) \* P7 _: K - #include <tccore/item.h>
3 f! V( ?2 I1 B5 d( P$ v - #include <tccore/method.h>
4 O+ {0 D4 A2 M4 x; q$ u - #include <metaframework/CreateInput.hxx>
2 C9 z- r; x; d
- Z1 j! Y$ i. D& @ Z8 [- extern "C" DLLAPI int A2_gtac_extension_rule(METHOD_message_t *m, va_list args)) K7 Q' ^- x" ]! `0 s' S
- {% I- Y2 z& ?9 l2 X
- printf("\n\n A2_gtac_extension_rule \n\n");6 }& { y5 @/ r# k9 W
! j E6 K: [1 M/ y( r2 \1 V' R- int ifail = ITK_ok;
* ^- q5 X3 z, U
: b" P3 R' _" f2 ]& Y' c- va_list largs;
8 C3 G: e- P( N - va_copy( largs, args );
* [1 R4 k% N! ] - Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);2 o$ a9 |) o5 w2 v2 `4 T0 H
- va_end( largs );
. y# |! A8 y. S. o, Y/ d4 r" x
/ g. [# w, U$ n8 I q* a- tag_t new_item = m->object_tag; 4 A4 W3 ~' C: U4 W
- char *uid = NULL;: o" O1 X+ X/ A; `. S
- ITK__convert_tag_to_uid(new_item, &uid);
0 l# [# |3 j [0 W. n I - printf(" new_item: %s \n", uid);% I! M9 \# b7 V8 N
- MEM_free(uid);
* C0 @+ ], a- n - " W8 Y% b" t: B5 Q* {, h0 a" q6 s
- 9 F2 Z+ `! O2 y0 g. I
- bool isNull = true;
2 V2 r; y( C# Z. | - tag_t new_rev = NULLTAG;
5 j) Z/ \. ^% r: X3 d! H! v2 s - ifail = creInput->getTag("revision", new_rev, isNull);
$ L E$ ^$ i2 V7 K& l - if((isNull == FALSE)&& (ifail == ITK_ok))
( @3 |/ Q6 U& A0 f% q! E, h - {
$ R. [# ^ G) ^" V - printf(" new_rev: %u \n", new_rev);
+ A1 {9 A$ `1 s - }7 A4 u, b7 {1 Z8 a
-
" a& \5 |/ \$ B: y2 w - tag_t master_form = NULLTAG;+ \/ u2 e$ n0 `2 e0 Q; y9 ^' K
- ifail = creInput->getTag("IMAN_master_form", master_form, isNull);" W v6 z+ b- ^& [
- if((isNull == FALSE)&& (ifail == ITK_ok)) A6 n ?- P9 j m5 c8 P/ e6 Y
- { J. q \/ M( G
- printf(" master_form: %u \n", master_form);$ r M& a$ P7 j0 y1 w$ t/ r) i
- }! Z! J9 t% a) |5 j6 F& l1 s
- 9 X/ M; e5 ]5 l$ M, R
- std::string item_id = "";
9 B$ d# o, s9 s. t L - ifail = creInput->getString("item_id", item_id, isNull);6 `) W" h \7 W! T8 l/ N; |7 E
- if((isNull == FALSE)&& (ifail == ITK_ok))) t: y. m& s0 J$ K2 ^3 P0 y
- {/ k; r/ `& A8 H" ?. M4 o
- printf(" item_id: %s \n", item_id.c_str());* t8 x1 x" C1 w9 C2 @9 o; e
- }( `8 m3 X8 l% t( i. K* D; T
- / ~/ \& T8 A# U4 y- V9 R% }- ?1 x
- std::string name = "";
8 _# a; C& ^2 M$ _ - ifail = creInput->getString("object_name", name, isNull);( _( H+ ~4 d& @' _7 y+ b( W, ]
- if((isNull == FALSE)&& (ifail == ITK_ok))
5 ?4 D( B! F% f% @ - {
* S1 h. r" Z, Q - printf(" object_name: %s \n", name.c_str());
+ ?' ^$ |# x- f8 S* Y - }' @) x* J$ ?7 o9 `3 O
* S/ D3 l, C$ J8 ]" u# o6 f- |- return ifail;;
# L) t+ Y: E- o/ }! u1 ]" y - }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 |
|