|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
}8 k. ?+ E) b/ t: uTeamcenter ITK二次开发源码分享: Item 创建 createpost操作
3 W& I2 ?: P, x) o9 v( z- #include <stdarg.h>. c" d0 z& w: @3 M* \/ M8 M2 S
- #include <stdio.h>
V! n+ Q* Z) ]% P e - #include <stdlib.h>
4 N/ Q6 o! h) y# Z - #include <string.h>
2 U- x5 d* K4 @: ]# V' n - #include <UG_va_copy.h>! l, \# Q8 a' J4 S
- #include <TC/emh.h>
) Y& v, r6 a8 B' g - #include <ict/ict_userservice.h>
+ H# ~4 V' V5 _8 O! y - #include <itk/bmf.h>% D3 r, j4 n7 v. S
- #include <tc/emh.h>% {6 G$ r) m; X5 j. Q
- #include <tc/tc.h>
) k1 k/ n' a, d0 c; \, o( g* b - #include <tccore/item.h>1 k) b: O: }+ T* m) C
- #include <tccore/method.h>/ k0 H; i7 X6 d3 m9 c6 v7 D
- #include <metaframework/CreateInput.hxx>% M8 m) }6 O4 f+ h$ H& z' |
- # n' R$ M! W. W2 u! t
- extern "C" DLLAPI int A2_gtac_extension_rule(METHOD_message_t *m, va_list args)
7 G. Z( h4 a o+ Z" [ - {5 K. {4 Q3 w3 F7 d+ E0 b
- printf("\n\n A2_gtac_extension_rule \n\n");
* w o, b. ]9 a7 y& B5 ?$ C
( \& w! W* Q5 r5 v0 I: L: K% w- int ifail = ITK_ok;0 M/ ^6 t! V" q9 \
V# P# `/ M# \: v- va_list largs;
* B* `6 y+ m* v8 E- t. T - va_copy( largs, args );
6 N Z" l( F5 W5 ?5 t) O8 n - Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);
' y7 d0 i2 J% w/ A - va_end( largs );% n, C1 B$ r5 q |0 Q
- * `# b4 E6 D7 ~8 C& s1 k
- tag_t new_item = m->object_tag;
, [; z3 E. p: l" y - char *uid = NULL;
# |; m$ q3 l8 m+ I- P5 K& ^5 C - ITK__convert_tag_to_uid(new_item, &uid);
1 G) q: t; ]% w( r* G - printf(" new_item: %s \n", uid);
4 g' v- ^' O6 V* r4 U) e - MEM_free(uid);
% S' I. B3 P$ H+ V - 4 D2 ~7 @5 E: T: g# s
- - S- }1 L5 d* H" J8 W/ G
- bool isNull = true;
3 b) Q3 V! x/ f: N' m- F - tag_t new_rev = NULLTAG;5 u1 ?( G( v' r! v
- ifail = creInput->getTag("revision", new_rev, isNull);, D# E1 E8 M- F$ y c
- if((isNull == FALSE)&& (ifail == ITK_ok))
3 {0 \4 y% [2 Z. D - {
6 V- Z1 I0 x, B: P - printf(" new_rev: %u \n", new_rev);0 V) w6 E2 W' F! R7 `' V: B0 O/ V
- }3 ^4 o( I4 ?+ V
- 6 z' Z% {1 r( f
- tag_t master_form = NULLTAG;
3 I5 P2 U* s' N( l' C* h6 k! B% g - ifail = creInput->getTag("IMAN_master_form", master_form, isNull);
9 r. m0 q, G1 i& [; u - if((isNull == FALSE)&& (ifail == ITK_ok))
1 `7 k% g! l$ o6 j* E: Y% n - {3 R p. G- U2 t) R: y) e
- printf(" master_form: %u \n", master_form);
' ?' Z+ D9 P( b7 m$ Z - }
3 }" p2 h( j/ a1 T
6 n E, @8 M( n$ O6 i8 V; i# G- std::string item_id = "";/ v9 T4 @- ~$ @+ c9 I
- ifail = creInput->getString("item_id", item_id, isNull);7 y( O p( t, i+ x( ?* X
- if((isNull == FALSE)&& (ifail == ITK_ok))
0 ~9 J3 Z5 q) [' C7 R$ e - {- N0 g, j4 q: w' `" W
- printf(" item_id: %s \n", item_id.c_str());
# j5 t' [; j' ^' a. r2 f$ s - }2 I" J, T6 t H& d7 B% i
8 a- {1 i5 g! @9 o% S- std::string name = "";
; m3 O# o8 }2 F( g0 U% t - ifail = creInput->getString("object_name", name, isNull);, C) J& n0 y1 R
- if((isNull == FALSE)&& (ifail == ITK_ok))/ B, A1 q' E, `/ _ n, w, w
- {7 q! j$ a+ Y9 r& j: g
- printf(" object_name: %s \n", name.c_str());8 P# }3 ~3 I' N6 ?+ |
- }- o( D1 O- y% Y' e) e- I" }
* x$ P# ?* R2 o3 z8 Q- return ifail;;$ Q* g# x5 e9 Q
- }6 C0 B. ^* t1 S$ ]8 k3 f
复制代码
: Z7 F/ \. I- h L) ]+ T- [( q, f" l0 R9 m
+ `8 C4 O4 ]7 W; | |
|