|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
8 l5 `/ N+ @1 s4 {* v- @$ e4 V
$ W& {2 o0 g7 i) \ j5 H0 j6 b8 oNX二次开发源码分享:报告当前Teamcenter是两层还是四层" v; N% B" B2 S) F8 H; f7 }" w$ i
- static void do_it(void)
/ \" O" j2 g3 F7 R; k* g0 w - {8 Y* w: U3 L4 a1 `( ]1 K0 ?" {
- logical IsManagedSession = FALSE;. q- i% g: Y. K8 A$ `" u1 x
-
5 ]* _. K7 f! p+ S) w. T - UF_is_UGmanager_active(&IsManagedSession);
1 b4 I4 Q. Q% |7 o) [ - * e' ]+ A) I* f1 [
- if(IsManagedSession == FALSE) return;; o* d; a, H$ O* D S( F
- % s1 |# O* a, [
- Session *theSession = Session::GetSession();
; d+ m4 ?% y9 B, I4 a - ListingWindow* lw;( q0 a$ L0 p4 u* E7 b
- lw = theSession->ListingWindow();; U/ ?0 u* M0 g: r" W% o6 Y
5 z( @9 v3 R- g# B7 P- NXString connectString;
0 e6 ^" Q3 k9 ]3 h$ j/ o - NXString discriminator;( V) S4 a' o1 } }
- / E( H: J$ s3 O3 P
- theSession->PdmSession()->GetTCserverSettings(&connectString,
# n2 `3 g3 g# g9 Y1 `& o - &discriminator);( C( @2 F8 a3 q% }0 ^, h8 p! I
-
- J- Z# U: N! F& S2 F - lw->Open();
) m& _* ~8 R2 e7 a( Y M -
9 \5 n ?* S% y3 X. k" R - /********************* uncomment to see the string values
2 N6 F4 v9 ?2 k# }
3 T5 h0 v% [0 T' M3 x0 V) ~& Q& w! t- lw->WriteLine("connectString: ");0 f" R- T$ p5 i9 c N
- lw->WriteLine(connectString);
5 k; r; z: G2 i - 7 V S X+ V* H3 F
- lw->WriteLine("discriminator: ");" ^1 _9 g* M" }5 e2 V1 N
- lw->WriteLine(discriminator);
( |- B+ v7 n) T - ( b; j: X! ^: _# W. H$ n
- lw->WriteLine("Note: Empty string indicates 2-tier");" c- `% G& ^( _ F; R9 P
- *************************************************************/
- J7 u7 H w# _! s0 A$ S) w - " Y, \7 Z3 i5 V/ s7 C
- const char * discriminatorString = discriminator.GetText();. J$ Y8 D4 H( S- O+ |5 R# n$ k7 N
- ! ^, _: E+ }1 k3 u
- size_t sl = strlen(discriminatorString);- n2 ?' \8 v% U3 m4 ]# B5 X
- ' ]8 D$ d* x6 S
- if((int)sl < 2)
% W- @) Z1 }3 r% m( ?9 A( a; n - {: ?% F. K" M0 a: e
- lw->WriteLine("This is a 2-tier session.");( d' c( \. \1 ^2 @+ T
- }! v) d& N1 j( q
- else# @! {9 S/ g0 X) j& v- H( f; U
- { c! M/ j% g' o. U* F
- lw->WriteLine("This is a 4-tier session.");
+ v& R9 c& A3 Z$ G4 u) p- F - }
8 J0 d: D# X; V9 Q - 4 m3 E. g' [0 A; P
- }6 l' _. B( k- O7 l2 Z- B2 |
复制代码 / F" s. v' B+ \; M9 [( A
6 J/ g3 N( Z: d |' i
2 L2 O3 l4 ~: L- x7 v% Q: w# b
|
|