|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
" C0 G6 z9 {7 M0 f( J; O
Teamcenter ITK二次开发源码分享: Item 创建 createpost操作
* @* x& }4 ~ J- #include <stdarg.h>3 A \4 G, Z8 [* _. S& q8 Z9 v
- #include <stdio.h>0 \6 H/ U( V( B# s7 [* C
- #include <stdlib.h>) Z$ J+ j% x5 K2 A3 Y
- #include <string.h>6 ?2 ^( s! @0 j" N2 h5 }
- #include <UG_va_copy.h>! q T) U$ J, ^3 |
- #include <TC/emh.h>
7 K. K: j3 J7 b; b9 J3 S - #include <ict/ict_userservice.h>
+ h$ z Y1 D/ q( s9 r! U$ L% b - #include <itk/bmf.h>
; f s( A/ G: ~5 ]3 Y3 O' E, Y$ a - #include <tc/emh.h>
6 g% }2 s' h, p' a! ]9 o6 ] - #include <tc/tc.h>
* ^& q% K' T, G - #include <tccore/item.h>' ~5 s& s( X2 e- J1 ?: ]
- #include <tccore/method.h>
4 D! P- G) E" Y) e0 M. l& F - #include <metaframework/CreateInput.hxx>) F8 n8 ~ Y5 f x4 K
- 7 Q! X2 {8 A! F+ {8 j0 F, E- H
- extern "C" DLLAPI int A2_gtac_extension_rule(METHOD_message_t *m, va_list args); ?4 F1 s& S+ O: p: j/ w+ Z
- {
6 M! K& U0 R" M7 p$ ^ - printf("\n\n A2_gtac_extension_rule \n\n");9 R/ e5 q2 x/ j8 Y- F
% N- i) _3 w; g" S5 Y' n' }- int ifail = ITK_ok;+ v0 ?! o8 X5 {4 Q) g T% M/ _
5 |- X6 P1 U% f- va_list largs;
6 [2 x a# _: F0 S' c H' S* ^ - va_copy( largs, args );
5 z( K0 \3 c7 S - Teamcenter::CreateInput *creInput = va_arg(largs, Teamcenter::CreateInput*);6 d0 Y- g! b" g5 Q0 S
- va_end( largs );
0 |8 [6 A c5 z0 w
+ I2 X5 |7 A7 S' N9 N$ k- tag_t new_item = m->object_tag; ( w& u: N& w" ~
- char *uid = NULL;2 r" w/ S8 k+ [/ _- x6 z3 W
- ITK__convert_tag_to_uid(new_item, &uid);" @9 y, x3 f# e6 a& K+ v
- printf(" new_item: %s \n", uid);
' w3 N' ~! R1 F - MEM_free(uid);& T+ ^5 Z ^: K
, H" l7 D H3 ?* F8 e- : B8 g7 A0 K2 a5 D
- bool isNull = true;
7 H9 ^. Y. H8 e/ R - tag_t new_rev = NULLTAG;0 B; X" N4 h0 M3 B
- ifail = creInput->getTag("revision", new_rev, isNull);% Z6 ^# c! Z* y- h' h: [- x) f
- if((isNull == FALSE)&& (ifail == ITK_ok))
% l+ Q$ N Q6 z9 `$ e* z! z - {
+ Q q3 ?2 \& A9 W% J, v - printf(" new_rev: %u \n", new_rev);5 n! S" T: t4 W
- }) G; R8 A7 G) |7 X5 k9 X+ J* a0 o
- 4 o) y6 y) Z* @7 C
- tag_t master_form = NULLTAG;
" |* `4 H2 ^+ U - ifail = creInput->getTag("IMAN_master_form", master_form, isNull);
/ {* d6 J5 S0 j9 e9 a6 n - if((isNull == FALSE)&& (ifail == ITK_ok))
+ a, v) X, u1 i. @) f - {# a6 e* h& W2 r% d) G. G
- printf(" master_form: %u \n", master_form);" X1 C% _% e. x7 {
- }& h9 t9 \. a' u6 E) R: g$ p' f
2 y( `0 E3 ^6 Z. x- std::string item_id = "";( {. C3 t/ I4 W* v8 V9 k0 X1 r
- ifail = creInput->getString("item_id", item_id, isNull);% w! U+ g$ `2 o V: x! M
- if((isNull == FALSE)&& (ifail == ITK_ok))5 \& \% K+ u3 O9 A L+ a, _
- {3 l9 d! ]3 l) }, `* i. d
- printf(" item_id: %s \n", item_id.c_str());% g- ?5 C$ ^2 I
- }/ }* e3 Q/ u3 U9 Q( O# I+ i
6 T. P, P7 y0 v9 {2 L- std::string name = "";
$ w; i1 X3 S; |9 K' U- _2 W - ifail = creInput->getString("object_name", name, isNull);
% A8 s8 ^, W! B$ y - if((isNull == FALSE)&& (ifail == ITK_ok))
( [# g# S+ _2 v - {& M+ j4 T2 F, e& l: f6 D- P8 M+ ?
- printf(" object_name: %s \n", name.c_str());
% _) {0 Z, n; I$ m - }
! C0 c! K% V" }5 o$ Q5 p - , [: h8 e! W8 R
- return ifail;;
3 e+ L# p+ M# b v/ {( y - }2 O5 q8 K' V. ?4 t$ p d
复制代码 # b6 d- x3 x3 J: |/ F
* n5 N h& L) Y8 H" }/ d
( l* R8 I3 r0 j" d9 H5 M ^
|
|