|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
5 ?9 L& l* a' t4 ETeamcenter二次开发源码分享:获取下一个Item ID的方法0 j2 a& Z0 O( I# }8 t
+ H! Q2 c6 K2 L1 S V) N1 M; q
[mw_shl_code=cpp,true]#include <iostream>! U! _& G! h) s2 O. G" i; d
- i7 s# [4 x, V3 I) N
#include <property/nr.h>
7 Y$ [# G) G% ^% r9 w) c$ W#include <TC/tc.h>7 u/ g: o4 C7 g. t$ I O# L
#include <tc/tc_startup.h>& \5 }6 e) k# g1 x- R6 p U3 t6 ~
#include <tccore/item.h>
! D! V& A, v. I( G#include <tccore/tctype.h>
! e+ B8 [, B6 X2 j& j0 I# g#include <base_utils/IFail.hxx>: z$ \3 A' v3 k( F3 e0 X+ D/ x8 m
#include <base_utils/TcResultStatus.hxx>
+ u E. U# R/ |#include <mld/logging/TcMainLogger.hxx>, g0 x. o8 A8 j
$ ^7 }8 {/ H$ q; v# ?0 F7 Z
using namespace std;( }; M1 m( v0 c& ~8 F3 B: M6 x
using Teamcenter::Main::logger;
$ n: b- ?/ [! {6 K, h- M1 _
; U4 i, k2 _% r) k! g- k" ?) Lint get_naming_rule_next_rev_id(tag_t item_tag, char **next_rev_id)
1 Y2 }) T' _) f2 j* J9 U% K- u{ g0 j! }" w- W$ c
int ifail = ITK_ok;
0 G' v) `$ | l; _ ResultStatus stat;
" h( N# ^: C2 l try
2 \% W9 |' r3 D! g {$ i% S! f+ g( {# h; M
tag_t item_type_tag = NULLTAG;9 \) K# }; R- t) n( ~2 ^1 J4 O# P
stat = TCTYPE_ask_object_type(item_tag, &item_type_tag);
0 S3 l8 F e/ ?4 ?2 C$ f
( n0 ]9 M* o0 j) ~- S! E, S1 v char *item_type_name = NULL;
- ?- u' T G, g" \- G stat = TCTYPE_ask_name2(item_type_tag, &item_type_name);; M- q) U0 T5 {/ _
& e2 X: ^; E4 Q, _& W
stat = NR_next_value(item_type_name, "item_revision_id", item_tag, "", "", "", NULLTAG, "", "", next_rev_id);
7 \3 I# z% A5 x. d d4 p+ F if (item_type_name) MEM_free(item_type_name);
) {# j- h: I; S( f& D! U5 M }
4 ^: w9 E2 k4 w. F0 k# _5 K catch (const IFail &ex)
k9 _/ i' d7 u2 v: `; P/ n {
! H8 s2 w7 f6 E! c logger()->error(ex.ifail(), ex.getMessage());; v" ]& Q6 s$ U5 K2 b8 K
cout << ex.getMessage() << endl;
/ t( h4 Y! U; S' l/ i cout << "error " << ex.ifail() << endl;
4 @5 b( `/ D$ s' g! L }
8 i! T" w2 d1 @3 @( r, x8 v* x return ITK_ok;
: j6 A n* N. l9 s}[/mw_shl_code]
! Y9 P4 I0 J1 B! I4 C# {' f |
|